+ Reply to Thread
Results 1 to 5 of 5

between formula

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    05-04-2005
    Posts
    136

    between formula

    is there any formula (I cannot use a macro for this) that I can put in that checks if a date is between two dates?

    i tried doing
    if(date>5/15/2005 and date<8/16/2005,"y","n")
    but this does not work.
    i know that i can do a nested if but i'm trying to stay away from that because this is already the fourth level of a nested if statement.

    any assitance would be greatly appreciated.

  2. #2
    Forum Expert swatsp0p's Avatar
    Join Date
    10-07-2004
    Location
    Kentucky, USA
    MS-Off Ver
    Excel 2010
    Posts
    1,545
    Try imbedding the AND function within your IF statement, such as:

    =IF(AND(B1>4,B1<6),"In Between","Not In Between")

    a value of 5 in B1 will return "In Between"

    HTH

    Bruce
    Bruce
    The older I get, the better I used to be.
    USA

  3. #3
    Forum Contributor
    Join Date
    05-04-2005
    Posts
    136
    that works. Thank you.

    another question:
    how do i compare the date
    say i want to do

    if(a1<5/15/2005)

    it's not treating 5/15/2005 as a date.
    How can I get it to do that?

  4. #4
    Forum Expert swatsp0p's Avatar
    Join Date
    10-07-2004
    Location
    Kentucky, USA
    MS-Off Ver
    Excel 2010
    Posts
    1,545
    Try this:

    if(a1<DATE(2005,5,15) the Date function use format (yyyy,m,d)

    HTH

    Bruce

  5. #5
    Forum Contributor
    Join Date
    05-04-2005
    Posts
    136
    thank you.

+ 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