Skip to content

How to calculate age from date of birth in Excel in Excel

Work out a person's age in whole years, or in years and months, from a date of birth with DATEDIF, and keep the as-of date in a cell.

You have dates of birth and need ages: in whole years for a roster, or in years and months for eligibility.

The cleanest tool is DATEDIF. It takes a start date, an end date and a unit. The unit "Y" gives complete years, "YM" gives the months left over after the complete years, and "MD" the leftover days. Excel keeps DATEDIF out of the function list and autocomplete, but it works in every current version.

=DATEDIF(B2, $G$1, "Y")

Keep the date you are measuring to in its own cell, here G1. That makes the sheet repeatable: use TODAY() for a live age, or type a fixed date such as a reporting date. Using a cell also means a printout from last month still shows the ages at the date you meant.

Why not subtract and divide? (today - birth)/365 drifts, because years are not 365 days, and it can give an age that is a day or two off around birthdays. DATEDIF counts complete years the way people do.

If you prefer not to use DATEDIF, this does the same thing with documented functions:

=YEAR($G$1)-YEAR(B2)-(TEXT($G$1,"mmdd")<TEXT(B2,"mmdd"))

It subtracts the years, then takes one off if the birthday has not happened yet this year. The Dates and finance track covers dates in depth.

2 ways to do it

1DATEDIF for whole years

=DATEDIF(B2,$G$1,"Y")

  1. Put the as-of date in a cell, for example G1. Use =TODAY() there for a live age.
  2. In C2 type =DATEDIF(B2,$G$1,"Y") and fill down.
  3. For years and months together, join two DATEDIF calls with &, using "Y" and "YM".

2Year difference minus one if the birthday is still to come

=YEAR($G$1)-YEAR(B2)-(TEXT($G$1,"mmdd")<TEXT(B2,"mmdd"))

  1. Subtract the birth year from the as-of year.
  2. Compare month and day as text, "mmdd". If the as-of date comes first, subtract one.

Try it yourself

Solve it in the sheet. Every answer is checked, with hints if you need them.

Task 1 of 2

In C2, return the age in complete years as of the date in G1, then fill down to C8.

Answer in C2, then it fills down to C8.

C2
A
B
C
D
E
F
G
1
Employee
Date of birth
Age
Age in detail
As of
30-Jun-2025
2
Employee 01
14-Mar-1992
3
Employee 02
02-Nov-1987
4
Employee 03
30-Jun-2001
5
Employee 04
21-Aug-1979
6
Employee 05
05-Dec-1995
7
Employee 06
17-Jan-1968
8
Employee 07
09-Sep-2003

Learn it properly, one graded sheet at a time.

Logic and text covers this in lesson 17, TEXT for formatting.