ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How do I find age in years from anniversary date (Age funtion)? (https://www.excelbanter.com/excel-worksheet-functions/171222-how-do-i-find-age-years-anniversary-date-age-funtion.html)

Enquire

How do I find age in years from anniversary date (Age funtion)?
 
I need to calculate age given birth-date.

First, I tried
=YEAR(NOW())-YEAR(cell ref with birthday)

This works, but (of course) the resulting year rolls-over on January 1, not
on the actual birthday.

I searched for "Age function" but (aside from Access) the closest I could
find was:

"How to calculate ages before 1/1/1900 in Excel" (Q245104)

http://support.microsoft.com/kb/245104/en-us

Well, I am not dealing with dates before 1900, but I tried it anyway (even
though I could not believe I needed a VB script to do this)

I created the VB script "AgeFunc" and then adapted the formula

=AgeFunc(startdate,enddate)

to

=AgeFunc(YEAR(NOW()),YEAR(AE353))

Where AE353 is the cell reference with the birth-date.

However, this returned the error #VALUE!

This is such a basic function ... one of the first "functions" that toddlers
understand ... how come I can't do this in Excel?!?

Surely there is a built-in "AgeFunc" in Excel ... can anyone help?!?

Thanks in advance


David Biddulph[_2_]

How do I find age in years from anniversary date (Age funtion)?
 
=DATEDIF(start_date,end_date,"y")
http://www.cpearson.com/excel/datedif.aspx
--
David Biddulph

"Enquire" wrote in message
...
I need to calculate age given birth-date.

First, I tried
=YEAR(NOW())-YEAR(cell ref with birthday)

This works, but (of course) the resulting year rolls-over on January 1,
not
on the actual birthday.

I searched for "Age function" but (aside from Access) the closest I could
find was:

"How to calculate ages before 1/1/1900 in Excel" (Q245104)

http://support.microsoft.com/kb/245104/en-us

Well, I am not dealing with dates before 1900, but I tried it anyway (even
though I could not believe I needed a VB script to do this)

I created the VB script "AgeFunc" and then adapted the formula

=AgeFunc(startdate,enddate)

to

=AgeFunc(YEAR(NOW()),YEAR(AE353))

Where AE353 is the cell reference with the birth-date.

However, this returned the error #VALUE!

This is such a basic function ... one of the first "functions" that
toddlers
understand ... how come I can't do this in Excel?!?

Surely there is a built-in "AgeFunc" in Excel ... can anyone help?!?

Thanks in advance





All times are GMT +1. The time now is 07:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com