Calculating age from date of birth and ignoring if blank

  • Thread starter news.eternal-september.org
  • Start date
N

news.eternal-september.org

I've used the following formula to calculate a person's current age in years
based on a previously entered date of birth:

=ROUNDDOWN(YEARFRAC(P2, TODAY(), 1), 0)

However, if I haven't entered any data in the date of birth column, the
result cell shows the age "110", which throws out other calculations. Is
there any way to tell Excel not to enter any data if the date of birth is
blank?
Many thanks
 
N

news.eternal-september.org

Thank you, that's exactly what I needed/

As you may have guessed, I'm fairly new to this!

"Cimjet" wrote in message
Hi
Try this : =IF(P2="","",ROUNDDOWN(YEARFRAC(P2, TODAY(), 1), 0))
HTH
John
 
C

Cimjet

You're welcome, glad I could help.
John
news.eternal-september.org said:
Thank you, that's exactly what I needed/

As you may have guessed, I'm fairly new to this!

"Cimjet" wrote in message
Hi
Try this : =IF(P2="","",ROUNDDOWN(YEARFRAC(P2, TODAY(), 1), 0))
HTH
John
 
Top