+ Reply to Thread
Results 1 to 4 of 4

Excel 2007 : =IF formula to identify "Yes" or "No" if between two dates

  1. #1
    Registered User
    Join Date
    10-08-2009
    Location
    Calgary Canada
    MS-Off Ver
    Excel 2010
    Posts
    20

    =IF formula to identify "Yes" or "No" if between two dates

    Good afternoon everyone, i'm a little stumped on a formula that I don't believe i should be having much issues with, and thought i'd ask around. The issue i'm having right now is i'm trying to compare 3 cells together to give me a "Yes" or "No" answer, here's what i'm trying to do

    Please refer to attachment.

    I'm trying to use a formula in D2 that looks to see if C2 falls in between the time and date for A2 and B2 that basically asks "Is this on time?"

    I want a formula that basically does both of these simultaneously:
    =IF(C2>A2,"Yes","No")
    =IF(C2<B2,"Yes","No")

    Any help is appreciated , thank you!
    Attached Files Attached Files
    Last edited by Rizzu; 07-13-2011 at 05:13 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    11-11-2008
    Location
    Euro
    MS-Off Ver
    2007, 2010
    Posts
    470

    Re: =IF formula to identify "Yes" or "No" if between two dates

    Quote Originally Posted by Rizzu View Post
    I want a formula that basically does both of these simultaneously:
    =IF(C2>A2,"Yes","No")
    =IF(C2<B2,"Yes","No")
    Any help is appreciated , thank you!
    try

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

    or (depend on your need)

    =IF(OR(C2>A2,C2<B2),"Yes","No")

  3. #3
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: =IF formula to identify "Yes" or "No" if between two dates

    Using your posted workbook, this regular formula returns Yes
    if the Delivery value is between the Early and Late values, inclusive:
    Please Login or Register  to view this content.
    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  4. #4
    Registered User
    Join Date
    10-08-2009
    Location
    Calgary Canada
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: =IF formula to identify "Yes" or "No" if between two dates

    Quote Originally Posted by tigertiger View Post
    try

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

    or (depend on your need)

    =IF(OR(C2>A2,C2<B2),"Yes","No")
    Aha! This one did the trick, i made one adjustment to your "and" formula and it did exactly what i needed it to (i didn't know (and( existed!)

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

    Thank you very much.

    Ron sadly median didn't do what i need it to , what i needed to do was make it identify if the Delivery Time fell between the Early Appointment and Late Appointment time to flag if it was late or not, so tiger's did exactly what i needed. Thank you both for your assistance

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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