View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Ron Rosenfeld[_2_] Ron Rosenfeld[_2_] is offline
external usenet poster
 
Posts: 1,045
Default Convert date to Age

On Wed, 7 Sep 2011 12:25:11 -0700 (PDT), D G wrote:

I need to convert a date of birth to age. However, I need to base it
on Sept 1, 2011. I need to know how old (years only) that person is
on that date. Does anyone know how to do this. Why is September 1,
2011 so important. It allows me to determine if they are eligible(too
young or too old) to play a sport.


The DATEDIF function should work properly for your purpose. However, it has not appeared in the HELP context of Excel except in Excel 2000 and, especially since a serious bug has crept into one of the parameters, is thought to be unsupported by MS.

If you would prefer another formula, which does not use DATEDIF, I would suggest:

=YEAR(TargetDate)-YEAR(DOB)-
(DATE(YEAR(TargetDate),MONTH(DOB),DAY(DOB))Target Date)

That merely subtracts the year of birth in DOB from the year in TargetDate (nominally 1-sep-2011), but adds back one if the birthday occurs later in the year than TargetDate.

The only issue of which I am aware, with that algorithm (which would not apply in your case), would be the determination of a leaplings birthday if TargetDate were 28 Feb; the leaplings birthday would not occur until 1 March. Depending on your jurisdiction, that may or may not be appropriate.