How to Calculate Age in Excel (DATEDIF Formula + Example)

๐Ÿ“… Updated August 26, 2026 โฑ 6 min read โœ๏ธ By Anchor AI Tools
Excel spreadsheet using the DATEDIF formula to calculate age from a birth date

Excel can calculate someone's exact age โ€” in complete years, or broken into years, months, and days โ€” from a birth date using the DATEDIF function. It's a single formula, and it updates automatically every day since it compares the birth date to today's date.

This guide from Anchor AI Tools covers the exact DATEDIF formula, how to get years/months/days together, a worked example with three birth dates, and the mistakes that trip people up most.

Quick Answer: To calculate age in Excel, use =DATEDIF(B2,TODAY(),"Y"), where B2 holds the birth date. This returns the person's age in complete years as of today. For a full breakdown, combine three DATEDIF calls to get years, months, and days.

The Age Formula (DATEDIF)

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

Returns age in complete years as of today

DATEDIF stands for "date difference." It takes a start date, an end date, and a unit code, then returns the difference between the two dates in that unit. For age, the start date is the birth date, the end date is TODAY() (or a fixed date, if you want the age as of a specific point in time), and "Y" means complete years.

DATEDIF is one of the few Excel functions that doesn't show up in the formula autocomplete list โ€” it's undocumented in the Excel interface, but it works fully and reliably when typed manually, and it's the standard way to calculate age in Excel.

Step-by-Step in Excel

  1. Enter the birth date in a cell. Make sure it's formatted as an actual date, not text โ€” for example, in column B.
  2. In another cell, enter the DATEDIF formula. =DATEDIF(B2,TODAY(),"Y").
  3. Press Enter. The cell returns the person's current age in complete years.
  4. Copy the formula down to calculate age for a full list of birth dates at once.
// Age in complete years: birth date in B2
=DATEDIF(B2,TODAY(),"Y")

Worked Example

Three birth dates, with age calculated as of August 25, 2026:

NameBirth DateAge (Years)Full Breakdown
Person AJune 8, 19943232 yrs, 2 mo, 17 days
Person BJan 15, 20002626 yrs, 7 mo, 10 days
Person CDec 1, 19883737 yrs, 8 mo, 24 days

๐Ÿ“‹ Formula Used

With birth date in B2, calculated as of today:

=DATEDIF(B2,TODAY(),"Y")
Person A's age: 32

Notice Person C's birthday (December 1) hasn't happened yet this year as of August 25 โ€” so DATEDIF correctly counts from their most recent birthday (December 1, 2025), not from January 1 of the current year. This is exactly what makes DATEDIF more reliable than simply subtracting birth year from the current year.

Age in Years, Months, and Days

To break age down fully โ€” the way a form or ID document often asks for it โ€” combine three DATEDIF calls with different unit codes into one text string:

// Full breakdown: birth date in B2
=DATEDIF(B2,TODAY(),"Y")&" years, "&DATEDIF(B2,TODAY(),"YM")&" months, "&DATEDIF(B2,TODAY(),"MD")&" days"
Unit CodeWhat It Returns
"Y"Complete years between the two dates
"YM"Remaining complete months, ignoring years
"MD"Remaining days, ignoring both years and months

For Person A (born June 8, 1994, calculated as of August 25, 2026), this returns "32 years, 2 months, 17 days" โ€” the same result shown in the worked example table above.

Alternative: YEARFRAC

If DATEDIF isn't available or you only need an approximate decimal age (for example, 32.2 years), YEARFRAC is a documented alternative:

=YEARFRAC(B2,TODAY())

Wrap it in INT() โ€” =INT(YEARFRAC(B2,TODAY())) โ€” to round down to complete years, similar to DATEDIF's "Y" unit. In practice, most spreadsheets use DATEDIF because it's simpler to read and gives clean years/months/days components without extra rounding.

Common Mistakes to Avoid

Putting the dates in the wrong order. The birth date (start date) must come before the end date. Reversing them returns a #NUM! error.

Storing the birth date as text instead of a real date. If the cell is left-aligned by default, it may be text โ€” DATEDIF needs an actual date value to work correctly.

Typing "DATEDIF" and expecting autocomplete to help. Since it's undocumented, Excel won't show argument hints as you type โ€” double-check your commas and quotation marks manually.

Forgetting that TODAY() changes daily. A DATEDIF formula using TODAY() recalculates every time the file is opened. If you need the age frozen at a specific point in time, replace TODAY() with a fixed date instead.

Who Needs to Calculate Age in Excel?

This comes up constantly for HR teams checking eligibility or retirement dates, schools and enrollment offices verifying student age, healthcare and insurance forms, event and membership sign-ups, and anyone maintaining a customer or contact list with birth dates.

Working with payroll hours instead of dates? See our guide on how to calculate median in Excel for typical values in a dataset, or try our time to decimal calculator for quick conversions.

Need more free calculators and formula guides?

Explore Free Tools โ†’

Frequently Asked Questions

What is the DATEDIF formula for age in Excel?
=DATEDIF(B2,TODAY(),"Y"), where B2 holds the birth date and "Y" returns the age in complete years.
How do I calculate age in years, months, and days in Excel?
Combine three DATEDIF calls: =DATEDIF(B2,TODAY(),"Y")&" years, "&DATEDIF(B2,TODAY(),"YM")&" months, "&DATEDIF(B2,TODAY(),"MD")&" days".
Does Excel have a built-in age calculator function?
Not a dedicated one, but DATEDIF is the standard way to calculate age โ€” it's a genuine Excel function, just left out of the formula autocomplete menu.
Why does my DATEDIF formula show a #NUM! or #NAME? error?
#NUM! usually means the start date is after the end date โ€” check that the birth date comes first. #NAME? usually means a typo in "DATEDIF" or a missing quotation mark around the unit code.
How do I calculate age as of a specific date instead of today?
Replace TODAY() with a fixed date or cell reference, for example =DATEDIF(B2,C2,"Y") where C2 holds the reference date.
Is DATEDIF accurate across leap years?
Yes. DATEDIF calculates based on actual calendar dates, so leap years are handled automatically and don't require any adjustment.

Related Free Guides & Tools From Anchor AI Tools

โš ๏ธ Accuracy Note: This guide explains a standard Excel formula for planning and educational purposes. For legal, medical, or eligibility decisions that depend on exact age, confirm the calculation with the relevant official documentation or a qualified professional.
A
Anchor AI Tools Editorial Team

We build free, fast, and accurate online tools and guides that explain the answer โ€” not just show a number. Used by small business owners, analysts, and freelancers every day.

Published by Anchor AI Tools ยท ยฉ 2026 Anchor AI Tools