+ Reply to Thread
Results 1 to 4 of 4

IF formula with dates

  1. #1
    Registered User
    Join Date
    02-24-2017
    Location
    France
    MS-Off Ver
    2007
    Posts
    86

    IF formula with dates

    Hi, I have a file with 4 columns with dates. Using if function, I am trying to check whether the last date is correct (within ranges of other dates). The date, which I am checking is in column D, the logic is that the date can't be less than date in column B and it can't be higher than column C. If column C is empty than not higher than column A. I was trying to use :=IF(AND(D2>=B2,D2<C2,D2<A2),"Yes","No"),but it doesn't seems to work. I'd appreciate some help with this formula.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,369

    Re: IF formula with dates

    Try this:

    =IF(AND(C2="",D2>=B2,D2<=A2),"Yes",IF(AND(D2>=B2,D2<=C2),"Yes","No"))
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: IF formula with dates

    1st question - are your dates real dates or text that looks like a date? test with =isnumber(A2)...FALSE indicates text dates and we will need to convert them (test the others, too)

    Then maybe consider upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,369

    Re: IF formula with dates

    Thanks for the rep!

+ 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] Formula to return the 'earliest' and 'latest' dates from a list of dates is not working
    By Hawkmoth1 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 03-21-2017, 07:14 AM
  2. [SOLVED] Require a formula to count unique dates excluding weekend dates
    By john dalton in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-09-2015, 09:17 AM
  3. [SOLVED] Creating a formula to populate range of cells between dates based on start and end dates
    By Rainmain82 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-20-2014, 07:42 PM
  4. [SOLVED] Creating a formula to populate range of cells between dates based on start and end dates
    By Rainmain82 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-18-2014, 07:55 AM
  5. Replies: 1
    Last Post: 06-14-2014, 02:01 AM
  6. Replies: 11
    Last Post: 05-04-2014, 08:28 PM
  7. Check dates in range either same dates or different dates by formula
    By breadwinner in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-12-2013, 07:42 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