# Microsoft Office Application Help - Excel Help forum > Excel Formulas & Functions >  >  IF statements using DATES

## tttt

Hello to all,

I am trying to use the IF forumla to see if the date in a cell is greter than or less than another date.

example
A1 =01/02/2007

I want to use an IF command to that says IF(A1<01/03/2007,OK, NOT OK)
however it always returns NOT OK.

Any ideas?
Thanks in advance.

----------


## daddylonglegs

Try

=IF(A1<"01/03/2007"+0,"OK", "NOT OK")

or

=IF(A1<DATE(2007,1,3),"OK", "NOT OK")

----------


## tttt

perfect.

thank you.

how about one more.
How would I go about checking the cell to see what month it is and putting out a result.

example
the "A" column has dates.
I want the B column to tell me what month is in text form.

so.. if a1 is in the range of 01/02/2007 to 28/02/2007 then B1 = FEBRUARY

----------


## Paul

In B1, use:

=TEXT(MONTH(A1),"mmmm")

----------


## tttt

> In B1, use:
> 
> =TEXT(MONTH(A1),"mmmm")



That seems to display "January" no matter what date is in A1

----------


## Paul

That's probably because I was temporarily stupid.   :Smilie: 

Try this instead:

=TEXT(A1,"mmmm")

----------


## tttt

ahh.. much less stupid..  thank you.   :Smilie:

----------

