Step-by-step guide

How to calculate age
in Excel

Calculate exact age in years, months, and days — useful for HR systems, membership databases, and any date-based analysis.

EP
ExcelPro·Sep 11, 2026

Basic age in years

=DATEDIF(birth_date, TODAY(), "Y") =DATEDIF(B2, TODAY(), "Y") -- Returns the number of complete years since the date in B2

Age in years and months

=DATEDIF(B2, TODAY(), "Y") & " years, " & DATEDIF(B2, TODAY(), "YM") & " months" -- Returns something like: "34 years, 7 months"

DATEDIF unit codes

CodeReturns
"Y"Complete years between the two dates
"M"Complete months between the two dates
"D"Total days between the two dates
"YM"Remaining months after subtracting complete years
"YD"Remaining days after subtracting complete years
"MD"Remaining days after subtracting complete months

Age at a specific date (not today)

=DATEDIF(B2, DATE(2026,1,1), "Y") -- Age as of 1 January 2026, regardless of today's date
⚠️ DATEDIF is undocumented

DATEDIF works in all Excel versions but Microsoft removed it from the official function list years ago. It still works, it just doesn't appear in autocomplete. Type it manually.

💡 Simple alternative without DATEDIF

=INT((TODAY()-B2)/365.25) gives approximate age in years and works in all versions. Less accurate for exact age (doesn't account for leap years precisely) but good enough for most purposes.

Practice what you just learned

ExcelPro has 880+ hands-on exercises across 9 tracks — type real formulas, get instant feedback.

Start practising free →
Keep reading