View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Use of IF function with years and months

Comparing microsoft date are in days. So you can do something like this

if(now() - datevalue("1/3/07") (2 * 365), True, False)

or

if(now() - dateserial(2007, 1, 3) (2 * 365), True, False)

or

if(now() - A3 (2 * 365), True, False)

"slacey" wrote:

I'm trying to use IF function with Years and Months in the cell being used to
perform logical argument and it does not appear to work.
I am trying to return different answers for a period of more than 2 years.
If numerical data in Cell shows more than 2 years, 0 months, IF true I want
to display "2+ years" if less than 2 years 0 months I want to display "Under
2 Years"
Any suggestions