Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Calculate a person's age from their date of birth in Excel.

Posted on 2013-05-29
6
Medium Priority
?
473 Views
Last Modified: 2013-05-30
Hello,

Suppose a person's date of birth (DOB) is displayed in cell A1 (as a date format such as "mm/dd/yy"). What (non-VBA) formula in Excel will calculate and display the person's age in years?

I realize that the formula will somehow include the difference:

    =TODAY() – DOB

but I am not quite sure what other functions to use and how to include them in the formula.

Also, Googling to various sites led to a couple of solutions which utilize the value 365.25 days per year (which is an approximation to account for leap year). However, I seem to remember seeing a solution in the past which does not include the approximation but calculates the answer directly. That's the formula I'm looking for.

Thanks
0
Comment
Question by:Steve_Brady
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 31

Expert Comment

by:Frosty555
ID: 39206386
How about YEARFRAC()?

http://office.microsoft.com/en-ca/excel-help/yearfrac-HP005209344.aspx

=YEARFRAC(TODAY(),A1)    

(where "A1" is the cell containing the date of birth)
0
 
LVL 35

Expert Comment

by:[ fanpages ]
ID: 39206418
Hi,

There is a discussion on date calculations within this recent thread:

"Excel formula that tells you the number of months" (20 May 2013)

[ http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Excel/Q_28133886.html ]

BFN,

fp.
0
 
LVL 24

Expert Comment

by:Steve
ID: 39206827
Using YEARFRAC and INT to give the age in whole years:
        =INT(YEARFRAC(A1,TODAY()))
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 50

Accepted Solution

by:
barry houdini earned 2000 total points
ID: 39207289
Hello Steve,

I see that fanpages' link has some discussion of DATEDIF and the possible problems with that function....but purely for age in years (i.e. using "y" as 3rd argument) I have not seen any instances where it doesn't give accurate results in any version of excel so that's what I'd use here

=DATEDIF(A1,TODAY(),"y")

DATEDIF is not very well documented by Microsoft - see here for more details

If you don't trust DATEDIF then this formula gives me the same results in all the tests I made

=YEAR(B1)-YEAR(A1)-(TEXT(B1,"mmdd")< TEXT(A1,"mmdd"))

where A1 and B1 are dates and B1 is later

Obviously I'm expecting that the age in years will increment only on the exact anniversary of the DOB (or on 1st March in non leap years for any 29th Feb DOBs). I noticed that The Barman's suggestion with INT and YEARFRAC works in most cases but not all, e.g. if DOB is 31-Jul-1963 then I'm getting 50 one day early on 30-Jul-2013

regards, barry
0
 

Author Closing Comment

by:Steve_Brady
ID: 39207826
Thanks Barry.
0
 
LVL 35

Expert Comment

by:[ fanpages ]
ID: 39208303
You're welcome, Steve_Brady.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question