ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How can I use a date in an IF/AND statement? (https://www.excelbanter.com/excel-discussion-misc-queries/34987-how-can-i-use-date-if-statement.html)

gsmith

How can I use a date in an IF/AND statement?
 
Trying to formulate =IF(c2 01/31/05, 1,"2") Is there a different date
format to use?

Thank you in advance for any help.

KL

Hi,

Try this:

=2-(C2VALUE("01/31/05"))

or

=2-(C2DATEVALUE("01/31/05"))

or

=2-(C2DATE(2005,1,31))

or

=IF(C2DATE(2005,1,31),1,2)

etc.

Regards,
KL


"gsmith" wrote in message
...
Trying to formulate =IF(c2 01/31/05, 1,"2") Is there a different date
format to use?

Thank you in advance for any help.




gsmith

Yahoo - that was exactly what I needed. Thank you KL!!

"KL" wrote:

Hi,

Try this:

=2-(C2VALUE("01/31/05"))

or

=2-(C2DATEVALUE("01/31/05"))

or

=2-(C2DATE(2005,1,31))

or

=IF(C2DATE(2005,1,31),1,2)

etc.

Regards,
KL


"gsmith" wrote in message
...
Trying to formulate =IF(c2 01/31/05, 1,"2") Is there a different date
format to use?

Thank you in advance for any help.






All times are GMT +1. The time now is 02:53 PM.

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