+ Reply to Thread
Results 1 to 9 of 9

IF DAY and MONTH fall between 2 dates then....

  1. #1
    Registered User
    Join Date
    10-15-2018
    Location
    London, England
    MS-Off Ver
    365
    Posts
    75

    IF DAY and MONTH fall between 2 dates then....

    Help please.....

    I need an IF formulae to provide a true statement if the 25th-31st December falls between 2 dates (in 2 separate cells) regardless of the year (to remain dynamic)

    I have attached a spreadsheet that hopefully provides further clarification
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: IF DAY and MONTH fall between 2 dates then....

    I think your date in D6 should relate to the year 2022, in which case you can use this formula in cell E5:

    =AND(DATE(YEAR(C5),12,25)>=C5,DATE(YEAR(C5),12,31)<=D5)

    then copy down.

    Hope this helps.

    Pete

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: IF DAY and MONTH fall between 2 dates then....

    I presume D6 was a typo being earlier than C6

    Assumin you meant 15 Jan 2022 then maybe in D5

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

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    10-15-2018
    Location
    London, England
    MS-Off Ver
    365
    Posts
    75

    Re: IF DAY and MONTH fall between 2 dates then....

    Sorry guys, I had my question slightly wrong.....

    I need the IF to return true if either of the below dates fall in the date range:
    - 25th Dec
    - 26th Dec
    - 27th Dec
    - 28th Dec
    - 29th Dec
    - 30th Dec
    - 31st Dec

    And I also apologise for the typo in the example, D5 should be 15/01/22

  5. #5
    Registered User
    Join Date
    10-15-2018
    Location
    London, England
    MS-Off Ver
    365
    Posts
    75

    Re: IF DAY and MONTH fall between 2 dates then....

    Sorry guys, I had my question slightly wrong.....

    I need the IF to return true if either of the below dates fall in the date range:
    - 25th Dec
    - 26th Dec
    - 27th Dec
    - 28th Dec
    - 29th Dec
    - 30th Dec
    - 31st Dec

    And I also apologise for the typo in the example, D5 should be 15/01/22

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: IF DAY and MONTH fall between 2 dates then....

    I presme you mean ANY of those dates, not EITHER, and why do you think the solutions you've been offered don't work?

  7. #7
    Registered User
    Join Date
    10-15-2018
    Location
    London, England
    MS-Off Ver
    365
    Posts
    75

    Re: IF DAY and MONTH fall between 2 dates then....

    I have tested both formula's against some other test data and it doesnt seem to be working on any......... I have attached said sample data

    Thank you for your help thus far
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: IF DAY and MONTH fall between 2 dates then....

    Its still not entirely clear, but
    =OR(AND(C13>=DATE(YEAR(C13),12,25),C13<=DATE(YEAR(C13),12,31)),AND(D13>=DATE(YEAR(D13),12,25),D13<=DATE(YEAR(D13),12,31)))

    might work although a range of 12/12/2019 to 12/01/2020 woudl return false and the answer is probably true, but if your ranges dont span years that is not a problem
    =IF(YEAR(C4)<>YEAR(D4),TRUE,OR(AND(C4>=DATE(YEAR(C4),12,25),C4<=DATE(YEAR(C4),12,31)),AND(D4>=DATE(YEAR(D4),12,25),D4<=DATE(YEAR(D4),12,31))))

    might overcome that

  9. #9
    Registered User
    Join Date
    10-15-2018
    Location
    London, England
    MS-Off Ver
    365
    Posts
    75

    Re: IF DAY and MONTH fall between 2 dates then....

    Davsth......... both work perfectly. Thank you very much

+ 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] Count all dates that fall within a specified month
    By nickpavlov in forum Excel General
    Replies: 6
    Last Post: 09-04-2019, 03:38 PM
  2. [SOLVED] How Many Days Fall in Each Month Between Two Dates
    By skate1991 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-17-2017, 09:21 AM
  3. [SOLVED] counting dates that fall within a set month
    By cjharwood in forum Excel General
    Replies: 5
    Last Post: 05-12-2016, 07:24 AM
  4. Count dates that fall in a certain month
    By bommar2 in forum Excel General
    Replies: 15
    Last Post: 04-28-2011, 11:41 AM
  5. Replies: 1
    Last Post: 10-25-2010, 05:44 PM
  6. Replies: 3
    Last Post: 04-08-2009, 04:00 PM
  7. Counting Dates that fall within a certain month
    By wnstar21 in forum Excel General
    Replies: 9
    Last Post: 01-26-2009, 12:24 PM

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