+ Reply to Thread
Results 1 to 8 of 8

Return a Month When Dates Cross over Calendar Month

  1. #1
    Registered User
    Join Date
    10-06-2016
    Location
    Atlanta, Georgia
    MS-Off Ver
    2010
    Posts
    9

    Question Return a Month When Dates Cross over Calendar Month

    Excel 2010:
    I need a formula that returns a particular month but because the date ranges cross over the calendar month, I cannot use the =TEXT(A2,"mmm") formula. For example, I need the formula to return JAN in cell A2 if the date in cell A1 is between 1/1/2016 and 1/29/2016. It should return FEB if the date in cell A1 is between 1/30/2016 and 2/26/2016. Also, the raw data was pulled down from another source and the date format is showing as [$-10409]m/d/yyyy. Does that matter?

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Return a Month When Dates Cross over Calendar Month

    Is there a complete pattern for all months ?
    Do you have those date ranges stored in a range of cells ?

  3. #3
    Registered User
    Join Date
    10-06-2016
    Location
    Atlanta, Georgia
    MS-Off Ver
    2010
    Posts
    9

    Re: Return a Month When Dates Cross over Calendar Month

    For my purposes, the last day of the month is the last Friday of each month. The next month starts on the very next calendar day and ends on the last Friday and so on.

    I just wrote down the ranges to make it easier to reference for formula creation:

    JAN 1/1/2016 - 1/29/2016
    FEB 1/30/2016 - 2/26/2016
    MAR 2/27/2016 - 3/25/2016
    APR 3/26/2016 - 4/29/2016
    MAY 4/30/2016 - 5/27/2016
    JUN 5/28/2016 - 6/24/2016
    JUL 6/25/2016 - 7/29/2016
    AUG 7/30/2016 - 8/26/2016
    SEP 8/27/2016 - 9/30/2016

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Return a Month When Dates Cross over Calendar Month

    So wouldn't January begin with the day immediately following the last friday of December 2015 ?
    i.e. Dec 26th 2015

    ?

  5. #5
    Registered User
    Join Date
    10-06-2016
    Location
    Atlanta, Georgia
    MS-Off Ver
    2010
    Posts
    9

    Re: Return a Month When Dates Cross over Calendar Month

    I had the very same thought lol! But I inherited this data so I am working with what I have. Besides when I checked the raw dataset, there was no data with date less than 1/1/2016 but to maintain the pattern you can change it to read

    JAN 12/26/2015 - 1/29/2016

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Return a Month When Dates Cross over Calendar Month

    Try

    =TEXT(WORKDAY.INTL(A2-1,1,"1111011"),"mmm")

  7. #7
    Registered User
    Join Date
    10-06-2016
    Location
    Atlanta, Georgia
    MS-Off Ver
    2010
    Posts
    9

    Re: Return a Month When Dates Cross over Calendar Month

    I think that worked!!! I am still doing a lil spot checking but Eureka! Thank you.

  8. #8
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Return a Month When Dates Cross over Calendar Month

    You're welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Calculation of days per month for dates beginning in one month and ending in another month
    By Fahrettin in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-07-2015, 04:52 PM
  2. [SOLVED] Formula to return End OF Month date with non-calendar month lengths.
    By Snoddas in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 05-09-2014, 08:45 AM
  3. Replies: 3
    Last Post: 01-21-2013, 08:10 PM
  4. Calendar Month and Year lists to Autofill Dates
    By devaltree in forum Excel General
    Replies: 1
    Last Post: 07-08-2012, 04:00 PM
  5. [SOLVED] Formula to Relist Ranges by Month Opening instead of Calendar Month
    By investmentbanker in forum Excel General
    Replies: 3
    Last Post: 05-18-2012, 01:33 PM
  6. Replies: 0
    Last Post: 03-27-2008, 04:36 PM
  7. Return Last Calendar Day of Month
    By paulmezick in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-13-2007, 11:18 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1