← All how-to recipes

How to calculate age in years and months

✓ Verified in LibreOffice 25.8.7.3

Show an exact age (or tenure) as "X years, Y months" rather than just years.

The formula

AppFormulaNotes
Excel=DATEDIF(A2,B2,"Y")&" years, "&DATEDIF(A2,B2,"YM")&" months"A2=start/birth date, B2=end date (use TODAY() for current age).
Google Sheets=DATEDIF(A2,B2,"Y")&" years, "&DATEDIF(A2,B2,"YM")&" months"Identical.
LibreOffice Calc=DATEDIF(A2,B2,"Y")&" years, "&DATEDIF(A2,B2,"YM")&" months"Identical.

How it works

DATEDIF with "Y" gives complete years; "YM" gives the leftover months after those years are subtracted — together they make "34 years, 5 months" for a birthdate of Feb 10, 1992 as of July 21, 2026. Add DATEDIF(...,"MD") for leftover days if you want all three parts. DATEDIF is undocumented in Excel's function wizard but works in all three apps — a survivor from Lotus 1-2-3 compatibility.

Verified, not just documented

We ran =DATEDIF(DATE(1992,2,10),DATE(2026,7,21),"Y")&" years, "&DATEDIF(DATE(1992,2,10),DATE(2026,7,21),"YM")&" months" in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned 34 years, 5 months — exactly the expected result. Every formula here is confirmed by actually executing it.