Use =DATEDIF(B2, TODAY(), "Y") with the date of birth in B2. It counts complete years, so the age only goes up on the birthday itself. Subtracting the years (YEAR(TODAY())-YEAR(B2)) is wrong for everyone whose birthday hasn't come yet this year.
{"cells": {"A1": "Name", "A2": "Anna", "A3": "Ivan", "A4": "Maria", "B1": "Born", "B2": 30450, "B3": 33970, "B4": 37800, "C1": "Age", "C2": "=DATEDIF(B2,$F$2,\"Y\")", "C3": "=DATEDIF(B3,$F$2,\"Y\")", "C4": "=DATEDIF(B4,$F$2,\"Y\")", "D1": "Years + months", "D2": "=DATEDIF(B2,$F$2,\"Y\")\u0026\" y \"\u0026DATEDIF(B2,$F$2,\"YM\")\u0026\" m\"", "D3": "=DATEDIF(B3,$F$2,\"Y\")\u0026\" y \"\u0026DATEDIF(B3,$F$2,\"YM\")\u0026\" m\"", "D4": "=DATEDIF(B4,$F$2,\"Y\")\u0026\" y \"\u0026DATEDIF(B4,$F$2,\"YM\")\u0026\" m\"", "F1": "Today", "F2": 46358}, "focus": "C2", "formats": {"B2:B4": {"fmt": "date"}, "F2": {"fmt": "date"}}, "note": "F2 holds a fixed date so the example stays the same; in your file use TODAY()."}
Age in years
"Y" counts complete years between two dates.
=DATEDIF(B2, TODAY(), "Y")Age today.=DATEDIF(B2, DATE(2026,12,31), "Y")Age at the end of 2026.Years and months
"YM" gives the months left over after the full years.
=DATEDIF(B2, TODAY(), "Y")&" years, "&DATEDIF(B2, TODAY(), "YM")&" months"Like 35 years, 4 months.Age with decimals
YEARFRAC returns years with a fraction, useful for averages.
=YEARFRAC(B2, TODAY())35.37, for example.Common mistakes
- #NUM! error
- The date of birth is after the second date. Check that the dates are in the right order.
- Ages are one year too high
- You subtracted the years. Use DATEDIF, which waits for the birthday.
Frequently asked questions
Why can't I find DATEDIF in Excel?
It's a hidden function kept for compatibility: it works, but Excel doesn't suggest it as you type. See DATEDIF.
How do I calculate years of service?
The same formula with the start date: =DATEDIF(C2, TODAY(), "Y").
How do I count days between two dates?
Just subtract them. See days between dates.