+ Reply to Thread
Results 1 to 8 of 8

Help with formula to find if nth day of month falls between 2 dates.

  1. #1
    Registered User
    Join Date
    11-11-2020
    Location
    Philadelphia
    MS-Off Ver
    Office 360
    Posts
    12

    Help with formula to find if nth day of month falls between 2 dates.

    Hello,

    I am having trouble finding a formula that finds whether a specific day of the month falls on or between 2 different dates. I.e. I need to determine if the 12th falls between 4/10 and 4/23, in this case the formula should return a "YES". I have attached a file with a few date ranges as well as a few formulas I've tried that have not worked. Any advise would be much appreciated!

    Example Sheet.xlsx
    Last edited by meegs; 05-02-2023 at 03:44 PM.

  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,813

    Re: Help with formula to find if nth day of month falls between 2 dates.

    Please revise your profile. I think you mean Office 365 (which is now called Microsoft 365).

    Starting on row 2, copy down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    It might be possible to come up with one that is more clever and shorter, but this will always work.

    This assumes that all pairs of dates are either in the same month or consecutive months. It won't work with 12/19/2022 - 2/5/2023.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,754

    Re: Help with formula to find if nth day of month falls between 2 dates.

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

  4. #4
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,108

    Re: Help with formula to find if nth day of month falls between 2 dates.

    edit - you have a few answers which have appeared while i was working on the solution and did not refresh - so maybe ignore this

    as indirect is volatile - and so not great to use if better alternatives as it recalculates all instances every time and can slow spreadsheet down


    i have modified this formula
    https://www.got-it.ai/solutions/exce...-between-dates
    to show the DAY of the month

    seems to work
    =SUMPRODUCT(--(DAY(ROW(INDIRECT(A2&":"&B2)))=12))

    DAY(ROW(INDIRECT(A2&":"&B2)))
    created an array of all the days between those dates

    then it just see if any are 12
    and counts how many there are

    add that to an IF()

    =IF(SUMPRODUCT(--(DAY(ROW(INDIRECT(A2&":"&B2)))=12))>0, "Yes","No")

    i'm assuming your version of excel is 365 and not 360 ????

    o array should automatically be created and not require
    control+shift+enter to work
    Attached Files Attached Files
    Last edited by etaf; 05-02-2023 at 03:31 PM.
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  5. #5
    Registered User
    Join Date
    11-11-2020
    Location
    Philadelphia
    MS-Off Ver
    Office 360
    Posts
    12

    Re: Help with formula to find if nth day of month falls between 2 dates.

    Thank you so much, this works!

  6. #6
    Registered User
    Join Date
    11-11-2020
    Location
    Philadelphia
    MS-Off Ver
    Office 360
    Posts
    12

    Re: Help with formula to find if nth day of month falls between 2 dates.

    This works as well, thanks so much!

  7. #7
    Registered User
    Join Date
    11-11-2020
    Location
    Philadelphia
    MS-Off Ver
    Office 360
    Posts
    12

    Re: Help with formula to find if nth day of month falls between 2 dates.

    Great option, gives me what I need. Thanks!!

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,754

    Re: Help with formula to find if nth day of month falls between 2 dates.

    Glad to help & thanks for the feedback.

+ 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. Find If A Month Falls Within A Range of Months
    By DBB1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-05-2022, 06:55 PM
  2. [SOLVED] Need Formula IF a MONTH & DAY falls in a Specific Week (or between 2 dates)
    By Pooger in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-31-2020, 08:55 PM
  3. Replies: 1
    Last Post: 07-02-2017, 08:02 PM
  4. Insert value if day of month falls between these two dates?
    By nashdesignguy in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-03-2016, 06:44 PM
  5. Determine if a month falls between two dates - YEARS OVERLAPPING
    By eekbubble in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 05-18-2015, 12:03 PM
  6. Replies: 4
    Last Post: 04-02-2015, 03:19 AM
  7. [SOLVED] count no. of dates in a column that falls on certain month & year
    By RawSugar in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-20-2005, 06:05 PM

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