• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 221
  • Last Modified:

Problem with IF statement

The below IF statement is not working as I need it to be

=IF(H2<10/29/2012,"Pre","Post")

What I need to do is check the date in H2 and if it is less than 10/29/2012 then return Pre, else return Post.
The date formating for H2 = xx/xx/xxxx
0
Frank Freese
Asked:
Frank Freese
2 Solutions
 
barry houdiniCommented:
10/29/2012 won't be recognised as a date like that,  try either

=IF(H2<"10/29/2012"+0,"Pre","Post")

or better to use unambiguous DATE function like this

=IF(H2<DATE(2012,10,29),"Pre","Post")

regards, barry
0
 
TeknodokCommented:
=IF(H2<DATEVALUE("10/29/2012"),"Pre","Post")
0
 
Frank FreeseAuthor Commented:
both great answers
thank you
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now