Use of IF function with years and months

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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)
 
=IF(DATEDIF(A1,A2,"Y")>=2,"2+ years","Under 2 years")

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
Bob: DATEDIF is not a standard worksheet function for excel 2003. which
version of excel are you using?
 
Joel,

I am using , 200, 2002/XP, 2003 and 2007. Although it doesn't appear in
Help, it is still there.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
Datedif works, but you can't add the function using the insert menu - function.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top