IF function and date range

H

Hummel Guy

I need the syntax for writing an IF function that can search a colum to see
if a date falls into a range. Ex: IF(D16= a date in jan 2009, true, false).

Thanks
 
R

Rick Rothstein

If you are just checking for month/year inclusions, you don't need to use a
range...

=IF(AND(MONTH(D16)=1,YEAR(D16)=2009),TRUE,FALSE)

Also, if all you want from the comparison is TRUE or FALSE, you don't need
the IF statement... the first argument to the IF statement evaluates to TRUE
or FALSE (that is how the function knows which of the next two arguments to
pick, so you can just use the first argument all by itself...

=AND(MONTH(D16)=1,YEAR(D16)=2009)
 
H

Hummel Guy

Thank you very much to both of you. I borrowed a piece of each and made the
application work.

Much Thanks
 
Top