Home โ€บ Blog โ€บ How to Calculate Age in Excel
โœ๏ธ Blog

How to Calculate Age in Excel

Every formula you need to calculate age from a date of birth in Excel or Google Sheets โ€” years, exact years-months-days, age in days, and decimal age โ€” with the pitfalls that break each one.

Excel has no AGE() function โ€” a strange gap for such a common need. Instead, age calculation relies on DATEDIF, a function so old it isn't even listed in Excel's formula autocomplete, plus a few date arithmetic tricks. This post covers every practical method to calculate age in Excel using a date of birth, from a single-cell years formula to a full years-months-days breakdown, and flags the quirks that produce silently wrong results.

Throughout, assume the date of birth is in cell A1, entered as a real Excel date (not text). Every formula works identically in Google Sheets unless noted.

Age in years: the DATEDIF formula

=DATEDIF(A1, TODAY(), "Y")

This returns completed years โ€” exactly how age works in real life. Someone born on 14 November 1992 shows as 33 until their birthday, then 34 from the birthday onward. DATEDIF takes three arguments: start date, end date, and a unit code. "Y" means full years between the two dates.

Why not just subtract the years? A formula like =YEAR(TODAY())-YEAR(A1) ignores whether the birthday has passed and overstates age for part of every year โ€” the same trap people fall into doing it by hand.

Age in years, months, and days

For the full breakdown ("33 years, 7 months, 22 days"), combine three DATEDIF units:

=DATEDIF(A1,TODAY(),"Y") & " years, " &
 DATEDIF(A1,TODAY(),"YM") & " months, " &
 DATEDIF(A1,TODAY(),"MD") & " days"

The unit codes work like this:

UnitReturns
"Y"Completed years
"YM"Months remaining after the years are subtracted (0โ€“11)
"MD"Days remaining after years and months are subtracted
"M"Total months between the dates
"D"Total days between the dates
Known quirk: Microsoft documents that the "MD" unit can return incorrect (occasionally negative) values around end-of-month dates โ€” for example, a 31st-of-the-month birthday evaluated on the 1st. If your spreadsheet feeds anything official, spot-check results near month boundaries against a calendar-accurate tool like our age calculator.

How to calculate age in days in Excel

Total days alive needs no function at all โ€” Excel stores dates as serial numbers, so subtraction just works:

=TODAY() - A1

One catch: because both values are dates, Excel sometimes formats the result as a date too. If you see something like 10/05/1930 instead of a number, change the cell format to General or Number. =DATEDIF(A1,TODAY(),"D") returns the same figure and never has the formatting problem.

From days, the other units are one step away: =(TODAY()-A1)/7 for weeks, =(TODAY()-A1)*24 for hours. These totals automatically include every leap day โ€” no adjustment needed.

Decimal age with YEARFRAC

=YEARFRAC(A1, TODAY(), 1)

This returns age as a decimal โ€” 33.64 years, say โ€” which is useful for statistical work, actuarial tables, or growth-chart plotting. The third argument 1 tells Excel to use actual month and year lengths rather than the default 30/360 accounting convention, which matters for accuracy. Wrap it in =INT(...) if you want completed years via this route instead of DATEDIF.

Age at a specific date (not today)

Replace TODAY() with a cell reference containing the target date โ€” an enrolment cutoff, an exam date, a policy start date:

=DATEDIF(A1, B1, "Y")

This is the spreadsheet version of the "Age at Date" field in our online age calculator, and it's the formula HR teams and school administrators use to check a whole column of birth dates against one cutoff โ€” put the cutoff in $B$1 (absolute reference) and fill down.

Common problems and fixes

Excel vs an online age calculator

Spreadsheets win when you have many birth dates to process at once. For a single age โ€” especially one that matters, like an eligibility check โ€” an online calculator is faster and sidesteps the MD quirk, text-date traps, and stale TODAY() values entirely. Our tool also gives you hours, minutes, and a birthday countdown that would take several more formulas to replicate.

Frequently asked questions

=DATEDIF(A1,TODAY(),"Y") where A1 holds the date of birth. It returns completed years, correctly accounting for whether the birthday has passed this year.
It's a legacy function kept for compatibility and deliberately left out of autocomplete. It still works in all Excel versions and Google Sheets โ€” just type it in full.
=TODAY()-A1, formatted as a number. Or =DATEDIF(A1,TODAY(),"D"). Both count actual elapsed days including leap days.
Yes โ€” DATEDIF, YEARFRAC, and TODAY() all behave identically in Google Sheets, including the same unit codes.

Just need one age, right now?

Skip the formulas โ€” enter a date of birth and get the full breakdown instantly.

Open the Age Calculator โ†’

Keep reading