+ Reply to Thread
Results 1 to 4 of 4

Find If A Month Falls Within A Range of Months

  1. #1
    Registered User
    Join Date
    01-07-2021
    Location
    Republic of Texas
    MS-Off Ver
    Office 365 Pro Plus
    Posts
    9

    Find If A Month Falls Within A Range of Months

    I am currently extracting the month from the LATEST date that appears in a column of dates. I would like to then perform an action if that month falls within a pre-defined range of months - day and year are not important, but the range of months could span into the following year, so it's not a contiguous range of Jan to Dec.

    For example, I have determined that "Nov" (or 11) is the month of the latest date that appears in my date column. I want a cell location to get the value of "6" if "Nov" falls within my target range of "Sep" thru "Feb." Numerically speaking, does 11 fall within the range of 9, 10, 11, 12, 1, and 2, and if so, put a 6 in a cell location?

    I do not yet have the 9 - 2 range of months defined anywhere.

    How would I go about doing this?

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,885

    Re: Find If A Month Falls Within A Range of Months

    A1 = month number of first month in target range
    B1 = month number of last month in target range
    C1 = month number of latest date

    =IF(A1>B1,OR(AND(C1>=A1,C1<=12),AND(C1>=1,C1<=B1)),AND(C1>=A1,C1<=B1))

    This gives TRUE or FALSE to indicate whether it's in the range. I don't see where you are getting 6 from.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    01-07-2021
    Location
    Republic of Texas
    MS-Off Ver
    Office 365 Pro Plus
    Posts
    9

    Re: Find If A Month Falls Within A Range of Months

    Thanks for responding so quickly! I'm testing your solution out with my scenario.

    (The "6" is just an internal value I want to put into a cell if those monthly conditions are met.)

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,885

    Re: Find If A Month Falls Within A Range of Months

    OK then

    Formula: copy to clipboard
    Please Login or Register  to view this content.

+ 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] Number of times a month/day falls on a certain day-of-week within a range of years
    By bird333 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-20-2020, 02:14 PM
  2. Calculate Number of weeks/months falls under each year between date range
    By dhitpit in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-12-2017, 10:06 AM
  3. [SOLVED] Count Occurrences Date Range Falls Within Month
    By Rbooth in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-25-2014, 06:47 PM
  4. [SOLVED] Extract value or sum total based on month criteria that falls within Data Range
    By Mysore in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-02-2013, 11:31 PM
  5. Return True or False if date range falls within current month
    By kieran614 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-17-2013, 12:02 PM
  6. Replies: 3
    Last Post: 07-31-2012, 04:44 PM
  7. Find which range a name falls into?
    By madbloke in forum Excel General
    Replies: 2
    Last Post: 02-21-2007, 05:02 AM

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