View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
David Biddulph[_2_] David Biddulph[_2_] is offline
external usenet poster
 
Posts: 8,651
Default Exclude blank data from formula calculation

But of course =YEAR($J$1)-YEAR(C2) doesn't calculate current age, it
calculates the age attained during that calendar year. For someone born in
December 2000, that formula would give their age as 8, whereas currently
they are 7. DATEDIF(C2,$J$1,"y") might be better, & can be nested in a test
for C2 not being blank as Gord suggested.
--
David Biddulph

"Gord Dibben" <gorddibbATshawDOTca wrote in message
...
=IF(C2="","no record of birthdate",YEAR($J$1)-YEAR(C2))


Gord Dibben MS Excel MVP

On Mon, 14 Apr 2008 02:57:00 -0700, Donna

wrote:

I have a formula =YEAR($J$1)-YEAR(C2) calculating age from date of birth.

However some of my entries do not have an entry for date of birth, so
their
'age' ends up as being (for example) 108.

Is there a way of making sure the formula does not calculate these ages?

Thanks