How to Calculate Age in Excel
If the date of birth is in B2, age today is the number of complete years between the two dates, which DATEDIF counts. If the birthday has not come yet this year, the age is one less.
Formula to use
=DATEDIF(B2, TODAY(), "Y")Age as of today
Age on a specific date
When the reference date is fixed, such as a start date or exam date, use that date instead of TODAY(). If the date is in a cell, use the cell address.
=DATEDIF(B2, DATE(2026,12,31), "Y")Age on December 31, 2026=DATEDIF(B2, C2, "Y")Age on the date in C2
Show "N years M months"
The "YM" unit counts the months left after whole years. Join the two results with & to show both, as is common for young children.
=DATEDIF(B2,TODAY(),"Y")&" years "&DATEDIF(B2,TODAY(),"YM")&" months"For example: 3 years 7 months
Age by calendar year (this year − birth year)
If you need an age that ignores the birthday and only subtracts years, take the years with YEAR and subtract them.
=YEAR(TODAY())-YEAR(B2)This year − birth year
Common mistakes
DATEDIF does not appear in AutoComplete, so you have to type it yourself. If the start date is later than the end date you get #NUM!.
If the date of birth is stored as text rather than a date (it shows left-aligned), you may get #VALUE!. Re-enter it as a date such as 1990-05-03, or convert it with DATEVALUE.
Dividing days by 365, as in (TODAY()-B2)/365, can be off by a day around birthdays because of leap years.
Try the functions used here
Change the arguments in the function playground and watch the calculation step by step.
- DATEDIF functionCounts the complete years, months or days between two dates. Use it for ages and lengths of service.
- TODAY functionReturns today's date. It updates every time the file recalculates.
- YEAR functionReturns the year (1900–9999) of a date as a number.
- DATE functionCombines year, month and day numbers into a single date.
FAQ
- The age shows as a date (such as 1900-01-25).
- The result cell is formatted as a date. Change the cell format to General or Number.
- Does it update every day?
- With TODAY(), it recalculates to today's date whenever the file is opened or recalculated.