+ Reply to Thread
Results 1 to 3 of 3

Using Formulas with Dates

  1. #1
    Registered User
    Join Date
    01-13-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Using Formulas with Dates

    This should be easy, simple, basic, but I can't figure out why it's not working.

    In A1 I have: =TODAY()
    In A2 I have: =IF(A1>="1/1/2011",1,0)
    A1 returns 1/13/2011, which is correct, todays date.
    A2 returns 0. WHY? Clearly A1>1/1/2011 right?


    I've worked it a bit and have found that if:

    In A2 I have: =IF(A1>=1/1/2011,1,0) (removed the quotations)
    A2 returns 1, which is correct.

    Keeping A1 the same:
    In A2 I have: =IF(A1>=2/1/2011,1,0) (no quotations, greater than February)
    A2 returns 0, which is incorrect.
    Adding the quotations back in, A2 returns 1, which is correct.

    Maybe I'm confused as to when to use quotations and when to not. Without quotations it should just be calculating the value of 1/1/2011, which is a very small number. With the quotations, I thought it should be comparing actual dates.
    Last edited by nosenga; 01-13-2011 at 01:33 PM. Reason: Solved

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,054

    Re: Using Formulas with Dates

    Maybe this:

    =(A1>=DATEVALUE("1/1/2011"))+0
    Never use Merged Cells in Excel

  3. #3
    Registered User
    Join Date
    01-13-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Using Formulas with Dates

    Yep, that works. Dates confuse me, I've never used DATEVALUE in other formulas and it seems to be working fine.

+ 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