ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Use of dates in conditional and AND formulas (https://www.excelbanter.com/excel-worksheet-functions/204406-use-dates-conditional-formulas.html)

Pam D in Indy

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

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

Peo Sjoblom[_2_]

Use of dates in conditional and AND formulas
 
Try

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

or


=IF(A1DATE(2004,1,1),1,0)


change the date the same way for your AND formula

--


Regards,


Peo Sjoblom

"Pam D in Indy" <Pam D in wrote in message
...
I'm not getting good values when I use dates in conditional or AND
formulas.
Example: =if(A11/1/2004),1,0)
Example: =IF(AND(A11/1/2004,A1<1/1/2007),1,0)

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




RagDyeR

Use of dates in conditional and AND formulas
 
Try it this way:

=IF(A1--"1/1/2004",1,0)

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Pam D in Indy" <Pam D in wrote in message
...
I'm not getting good values when I use dates in conditional or AND
formulas.
Example: =if(A11/1/2004),1,0)
Example: =IF(AND(A11/1/2004,A1<1/1/2007),1,0)

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




David Biddulph[_2_]

Use of dates in conditional and AND formulas
 
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.
--
David Biddulph

"Pam D in Indy" <Pam D in wrote in message
...
I'm not getting good values when I use dates in conditional or AND
formulas.
Example: =if(A11/1/2004),1,0)
Example: =IF(AND(A11/1/2004,A1<1/1/2007),1,0)

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





All times are GMT +1. The time now is 04:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com