View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Woodloch
 
Posts: n/a
Default How do I use an "IF" formula using dates in excell?

Maybe you can help. Saw this and this is my question.

I have a date say 1/1/2005 in say cell J7; I want to write an if formula
that says if J7 is less than 7/1/2006 then it returns "expired" and if not it
returns "current"

Thanks

"bpeltzer" wrote:

Assuming these cells are really dates and by 'ends in' you mean 'is in the
year', then you would do something like
=if(year(a1)=2005,true_value,false_value). If they're really strings that
end in 2005, then =if(right(a1,4)="2005",true_value,false_value)

"Mike" wrote:

How do I use an "IF" function involving dates. For Example: (IF (a date in
one cell ends in 2005 THEN "x"),IF( a date in one cell ends in 2006 THEN
"Y"), " ")