Use of dates in conditional and AND formulas

P

Pam D in Indy

I'm not getting good values when I use dates in conditional or AND formulas.
Example: =if(A1>1/1/2004),1,0)
Example: =IF(AND(A1>1/1/2004,A1<1/1/2007),1,0)

Everything comes back either true or false, but not true to case.
 
P

Peo Sjoblom

Try

=IF(A1>--"2004-01-01",1,0)

or


=IF(A1>DATE(2004,1,1),1,0)


change the date the same way for your AND formula

--


Regards,


Peo Sjoblom
 
D

David Biddulph

1/1/2004 is equal to 1 divided by 1 then divided by 2004, which gives a
number equivalent to a date and time of 43.11 seconds after midnight on 0th
Jan 1900.
That's the date and time with with you are comparing. That's why the other
folk have told you how to put the correct date into your formula.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top