Calculate exact age in years, months, and days — useful for HR systems, membership databases, and any date-based analysis.
=DATEDIF(birth_date, TODAY(), "Y")
=DATEDIF(B2, TODAY(), "Y")
-- Returns the number of complete years since the date in B2=DATEDIF(B2, TODAY(), "Y") & " years, " & DATEDIF(B2, TODAY(), "YM") & " months"
-- Returns something like: "34 years, 7 months"| Code | Returns |
|---|---|
| "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 |
=DATEDIF(B2, DATE(2026,1,1), "Y")
-- Age as of 1 January 2026, regardless of today's dateDATEDIF 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.
=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.
ExcelPro has 880+ hands-on exercises across 9 tracks — type real formulas, get instant feedback.
Start practising free →