DateDif Problem

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

Guest

I will try my best to explain myself. I have a worksheet in which cell A1:A6
contain Date of Birth, Cell B1:B6 contain the age by using =DateDiff(A1,
Now(), "Y") and finally I have a question that asks if there is anyone >=65
(years old), this question is an if, or statement. The issue is that when a
cell in A1:A6 is blank the corresponding cell in column B returns a 106.
Therefore my question always returns a "Yes" becuase if any cell in A1:A6 is
blank I will get a 106.
I would like to find a way to make this work. Any suggestions?
 
It's hard to say without seeing the formula, but you just need to test the A
value for blank.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
Change your datedif formula to this...

=IF(A1=0, 0, DATEDIF(A1, NOW(),"Y"))

Which will avoid the 106 (number of years elapsed since 1900)
 

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