Dates Within IF Statements

T

TONYC

I am attempting to include dates within an IF statement

for example

=IF(P23>"01/04/04",L23, " ")

I have tried with and without quotation marks. Neither work. Is i
possible to incorporate greater than a specifiied date?

Regards

TON
 
T

TONYC

Thank you. I have since found out that the following also works

IF(P23>DATE("01/04/04"),L23, " ")

Regards

TON
 
J

JE McGimpsey

That *should* give you an error when you try to enter it.

Perhaps you meant

=IF(P23>DATE(4,4,1),L23, "")

or, depending on your date convention:

=IF(P23>DATE(4,1,4),L23, "")
 
R

Ron Rosenfeld

Perhaps you meant

=IF(P23>DATE(4,4,1),L23, "")

or, depending on your date convention:

=IF(P23>DATE(4,1,4),L23, "")

By "date convention" do you mean the order of month, day, year?

I thought the argument order of the DATE worksheet function was independent of
the date convention.

I guess I can check it ... With XL2002 Win XP Pro it seems to give the same
date result, independent of the date convention (US vs UK). Of course, the
answer is formatted differently.




--ron
 
J

JE McGimpsey

DATE() *is* independent of the date convention (e.g., d/m/y or m/d/y)

My caveat was due to the OP having used an ambiguous date:
DATE("01/04/04")

so I couldn't be sure which date he meant.
 
T

TONYC

I send my apoligies. I did mean to change the date to read



=IF(P23>DATE(2004,4,1),L23, "")

Which does work successfully.

Regards
Ton
 
Top