Skip to content

How to Calculate Age in Excel: Easy Formulas for Years, Months, and Days

how to calculate age in Excel

If you want to calculate age in Excel, the simplest approach is to use the DATEDIF function together with TODAY(). Put a date of birth in one cell, and a formula like =DATEDIF(A2,TODAY(),"Y") will return the person’s completed age in years, updating automatically every time the workbook is opened.

That single formula solves the most common request, but it isn’t the whole picture. Age calculations get more complicated the moment you need months and days as well as years, an age on a specific past date rather than today, a whole column of people instead of one, or a birth date that falls on February 29. This guide works through all of that, with real formulas, real examples, and the mistakes that trip people up most often.

If you’d rather skip the spreadsheet entirely — say you just need one person’s exact age right now — a chronological age calculator will do the same calculation instantly in a browser, without any formula-building at all. For anyone managing a list of birth dates in a workbook, though, Excel is still the more practical tool, and the rest of this guide covers it in full.

Quick Answer

To calculate someone’s completed age in Excel when their date of birth is in cell A2, use:

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

A2 holds the date of birth, TODAY() returns the current date, and "Y" tells DATEDIF to return only complete years — so a person doesn’t get counted as a year older until their birthday actually arrives. This is the formula behind almost every other technique in this article.

How to Calculate Age in Excel

Start with a simple three-column layout:

CellContents
A2Date of Birth
B2Current Date
C2Calculated Age

In practice, most people skip column B and use TODAY() directly inside the formula, since it always reflects the current date without needing its own cell. So the working formula in C2 becomes:

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

Here’s what each part is doing:

  • A2 contains the date of birth, entered as an actual Excel date (more on why that matters in the troubleshooting section below).
  • TODAY() is a volatile function that always returns the current date according to your computer’s clock.
  • “Y” is the unit argument. It tells DATEDIF to count only whole, completed years between the two dates — not a rounded or approximate figure.
  • The result is the person’s current completed age in years.

<cite index=”9-1″>Microsoft describes DATEDIF as a function you use when you want to calculate the difference between two dates, and notes it’s particularly useful in formulas where you need to calculate an age.</cite> It’s worth knowing that DATEDIF is something of an odd function in Excel: it works perfectly well, but <cite index=”9-1″>Excel keeps it around mainly to support older workbooks built in Lotus 1-2-3</cite>, which is why it doesn’t appear in the Insert Function dialog or offer autocomplete hints as you type it. You just have to type the full function name and its three arguments from memory (or from this article).

The Best Excel Formula for Calculating Age

For a straightforward “how old is this person right now” question, =DATEDIF(A2,TODAY(),"Y") is the formula most people should reach for. It’s short, it’s readable, and — critically — it handles the one thing that trips up simpler approaches: it only counts a year as complete once the birthday has actually occurred.

That distinction matters because there’s a world of difference between:

  • Completed age — the number of full years a person has actually lived, which is what “age” normally means in everyday use.
  • Calendar year difference — simply subtracting the birth year from the current year, which ignores whether the birthday has happened yet this year.

Here’s where the difference shows up. Someone born on December 20, 1995 is still only 30 years old — not 31 — on December 1, 2026, even though 2026 minus 1995 equals 31. Their birthday hasn’t arrived yet this year, so the completed year hasn’t been reached. DATEDIF with “Y” gets this right automatically; a plain year subtraction does not. We’ll come back to that specific mistake later, since it’s one of the most common errors in Excel age calculations.

How to Calculate Age From Date of Birth in Excel

Here’s the full process from a blank spreadsheet to a working result:

  1. Enter the date of birth in a cell — for example, A2.
  2. Confirm Excel recognizes it as a date, not as text. A properly recognized date is right-aligned in the cell by default; text is left-aligned.
  3. Use TODAY() as the end date in your formula rather than typing today’s date manually, so the result updates on its own.
  4. Write the DATEDIF formula: =DATEDIF(A2,TODAY(),"Y").
  5. Format the result cell as a number, not as a date — Excel occasionally tries to auto-format a DATEDIF result using a date format, which produces a nonsensical-looking output.
  6. Copy the formula down the column if you’re calculating age for more than one person.

Applied to a small table, using DD/MM/YYYY dates and today’s date of August 21, 2026:

NameDate of BirthAge
Alex15/04/1990=DATEDIF(B2,TODAY(),"Y") → 36
Sarah08/11/1985=DATEDIF(B3,TODAY(),"Y") → 40
Daniel22/07/2002=DATEDIF(B4,TODAY(),"Y") → 24

Alex and Daniel have both already had their birthdays this year (April and July, both before August), so their ages reflect a completed year for the current calendar year. Sarah’s birthday is in November, which hasn’t happened yet, so DATEDIF correctly holds her age at 40 rather than jumping to 41 early.

How to Calculate Age in Years, Months, and Days in Excel

This is where DATEDIF earns its keep, because it can return each component separately.

Years:

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

Remaining months (after the completed years are removed):

=DATEDIF(A2,TODAY(),"YM")

Remaining days is where things get more delicate. The obvious next step is =DATEDIF(A2,TODAY(),"MD"), and it will often work — but Microsoft is explicit that it shouldn’t be trusted blindly. <cite index=”6-1″>The “MD” argument may result in a negative number, a zero, or an inaccurate result</cite> in certain date combinations, particularly around month-end dates and leap years. This isn’t a rare edge case dreamed up by cautious documentation writers — <cite index=”10-1″>the warning has caused a fair amount of confusion among Excel users, since it isn’t always obvious exactly when the problem will occur or how serious it will be</cite>.

A more reliable way to get the remaining-days figure is to calculate it directly, rather than relying on “MD”:

=TODAY()-DATE(YEAR(TODAY())-DATEDIF(A2,TODAY(),"Y"),MONTH(A2)+DATEDIF(A2,TODAY(),"YM"),DAY(A2))

This looks intimidating, but the idea is simple: it reconstructs the date that would be exactly “years and months ago” from today, then subtracts that from today’s actual date to get the leftover days. Microsoft’s own documentation offers a related workaround along the same lines <cite index=”6-1″>for calculating remaining days after the last completed month, by subtracting the first day of the ending month from the original end date</cite> — though as several Excel users have pointed out, that particular version only holds up cleanly when the start date falls on the first of a month, so it isn’t a universal fix either. For everyday spreadsheets, the safest approach is to use “Y” and “YM” with confidence, and treat any days-remaining figure as an approximation unless you’ve tested it against your specific dates.

Put together, a full years/months/days formula looks like this:

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

For someone born March 12, 1995, calculated against today’s date (August 21, 2026), this returns 31 years, 5 months, 9 days — 31 full years since the birth date, 5 more completed months since the most recent birthday, and 9 leftover days since the last completed month. That specific example happens to fall on a date combination where “MD” behaves correctly, but as covered above, it’s worth double-checking against your own real dates rather than assuming it always will.

How to Calculate Age as of a Specific Date in Excel

Not every age calculation is about “today.” You might need someone’s age as of a hire date, a test date, an application deadline, or a historical event.

ABC
Date of BirthAs-of DateAge
=DATEDIF(A2,B2,"Y")

The only change from the earlier formula is swapping TODAY() for a specific date in B2. This version is useful for:

  • Historical age calculations (how old was someone on a given date in the past)
  • Employment and HR records
  • School enrollment cutoffs
  • Research and demographic datasets
  • Eligibility checks tied to a fixed date rather than the current date
  • Event planning where attendees’ ages matter on the event date, not today

One rule matters here: the as-of date in B2 must not fall before the birth date in A2, or DATEDIF returns a #NUM! error — more on that in the troubleshooting section.

As an example, Daniel from the earlier table (born July 22, 2002) would have been 17 as of January 1, 2020 — his 2020 birthday hadn’t happened yet in July, so the completed-years count for that January date sits one lower than a simple year subtraction would suggest.

How to Calculate Age Automatically Using TODAY()

The reason =DATEDIF(A2,TODAY(),"Y") is so widely used is that it needs no manual updating. TODAY() is a volatile function, meaning Excel recalculates it every time the workbook opens or recalculates — so the age shown will always reflect the current date, without anyone needing to re-enter anything.

That has one practical implication worth knowing: if you open a workbook that uses TODAY() a year from now, every age in it will have quietly updated to match the new date. That’s usually exactly what you want for a running age tracker, but it also means TODAY()-based formulas aren’t suitable for archival records where you specifically want to preserve the age as it was calculated on a particular day — for that, use the as-of-date version from the section above instead.

How to Calculate Age for Multiple People in Excel

Once the formula works for one row, extending it to a whole list is mechanical:

NameDate of BirthCurrent Age
Person 1Date=DATEDIF(B2,TODAY(),"Y")
Person 2Date=DATEDIF(B3,TODAY(),"Y")
Person 3Date=DATEDIF(B4,TODAY(),"Y")

To do this:

  • Enter the formula once in the first row.
  • Select that cell, then double-click the fill handle (the small square at the bottom-right corner of the cell) to fill it down automatically to match the rest of your data — or drag it down manually.
  • Because the date-of-birth reference (B2, B3, B4…) is a relative reference, it shifts automatically for each row, while TODAY() stays the same for every row since it takes no cell reference at all.
  • If you convert the range into an Excel Table (Insert > Table), the formula will automatically extend itself to any new rows you add underneath, without needing to re-copy it.

There’s no need to use absolute references (the $A$2 style) here, since every row should point to its own date of birth rather than a fixed cell.

How to Calculate Age in Excel Without DATEDIF

DATEDIF isn’t the only route to an age calculation. A common alternative, using only documented, fully supported functions, is:

=YEAR(TODAY())-YEAR(A2)-IF(DATE(YEAR(TODAY()),MONTH(A2),DAY(A2))>TODAY(),1,0)

Broken into pieces:

  • YEAR(TODAY())-YEAR(A2) does a simple calendar-year subtraction — the naive approach that can be a year too high.
  • DATE(YEAR(TODAY()),MONTH(A2),DAY(A2)) rebuilds this year’s version of the birthday, using the current year but the person’s actual birth month and day.
  • IF(...>TODAY(),1,0) checks whether that reconstructed birthday hasn’t happened yet this year. If it hasn’t, it subtracts 1 to correct the count.

The result matches what DATEDIF’s “Y” unit returns, just built from fully documented, always-supported functions rather than DATEDIF. The trade-off is readability: DATEDIF is shorter and easier to explain to someone else, while the YEAR/MONTH/DAY version is more verbose but avoids relying on a function Excel officially treats as legacy. Neither one is universally “better” — DATEDIF is fine for the vast majority of everyday spreadsheets, and the longer formula is a reasonable alternative if you specifically want to avoid unsupported functions in a workbook other people will maintain.

DATEDIF vs YEAR-Based Age Formulas

MethodBest forAdvantagesLimitationsDifficulty
DATEDIF (“Y”, “YM”)Quick age-in-years or years+months calculationsShort, readable, widely usedOfficially unsupported by Microsoft; “MD” unit unreliableEasy
YEAR/MONTH/DAY formulaWorkbooks avoiding legacy functionsUses only fully documented functionsLonger, harder to read at a glanceModerate
DATEDIF with a fixed as-of dateHistorical or record-based ageDoesn’t rely on TODAY(); good for archivesNeeds manual date entry per recordEasy
Online chronological age calculatorA single quick calculation, no spreadsheet neededInstant, no formulas to buildNot suited to bulk/spreadsheet dataVery easy

How to Calculate Age in Excel From a Birth Year Only

Sometimes all you have is a birth year — 1998, say — rather than a full date like March 15, 1998. In that case, Excel cannot return an exact chronological age, because it has no month or day to compare against today’s date.

The best it can do is an estimate: subtract the birth year from the current year to get either the person’s age this year, or that age minus one, depending on whether their birthday has already passed — and without a month and day, there’s no way for the spreadsheet to know which. If accuracy matters, the birth year alone isn’t enough data; you’ll need at least a full date to get a genuine completed-age figure rather than a one-year range.

How to Calculate Age in Excel When the Birthday Has Not Happened Yet

This is the single most common mistake in Excel age calculations. A formula like:

=YEAR(TODAY())-YEAR(A2)

looks reasonable, but it will overstate a person’s age by one full year for anyone whose birthday hasn’t occurred yet this calendar year.

For example, someone born on November 8, 1985 is not yet a year older on, say, June 1 of the current year, even though the current year minus 1985 gives a number that assumes they are. The fix is exactly what DATEDIF’s “Y” unit already does automatically: check whether the birth month and day have occurred yet this year, and only count the year as complete if they have. That’s the entire reason DATEDIF (or the equivalent YEAR/MONTH/DAY logic above) is preferable to a bare year subtraction — it builds that check in rather than leaving it out.

How to Calculate Age in Excel for Leap-Day Birthdays

A birth date of February 29 only exists in leap years, which creates an obvious question in every non-leap year that follows: does that person’s birthday effectively fall on February 28, or on March 1?

Excel’s date system handles February 29 birthdays the same way it handles any other date mathematically — DATEDIF still counts complete years correctly regardless of which convention you use for “when” the birthday falls in a non-leap year, because the underlying day-count arithmetic doesn’t depend on a birthday being celebrated on any particular date. The practical question of whether a February 29 birthday should be treated as falling on February 28 or March 1 for purposes like eligibility cutoffs is a matter of convention (and, in some contexts, of law), and it varies by organization and jurisdiction. If a specific legal age threshold is involved — voting age, drinking age, contract age, and similar — check the relevant authority for that jurisdiction rather than relying on a spreadsheet convention alone.

Common Excel Age Calculation Errors

Error 1: Excel shows a strange number instead of an age

This usually means the result cell is still formatted as a date rather than a number. Excel stores dates as sequential serial numbers, and if a cell inherits date formatting from a neighboring cell, a perfectly correct age calculation can display as something like a date in the 1900s. Fix it by changing the cell format to “Number” or “General.”

Error 2: DATEDIF returns #NUM!

<cite index=”6-1″>If the start date is later than the end date, DATEDIF returns #NUM!.</cite> Double-check that the date of birth is genuinely earlier than the “as of” date (or than TODAY()) — a common cause is the two dates being accidentally swapped in the formula.

Error 3: Age comes out one year too high

This is the birthday-not-yet-reached problem covered above — usually caused by a plain YEAR(TODAY())-YEAR(A2) subtraction rather than DATEDIF’s “Y” unit or the equivalent corrected formula.

Error 4: Excel is treating the date as text

If a date is left-aligned in its cell (dates are normally right-aligned by default) or DATEDIF returns a #VALUE! error, Excel likely sees it as text rather than a real date. Re-enter it using Excel’s date input, or use Data > Text to Columns to force a conversion.

Error 5: Regional date format confusion

Excel can interpret dates as MM/DD/YYYY, DD/MM/YYYY, or YYYY-MM-DD depending on regional settings, and a date like 03/04/2020 is genuinely ambiguous between “March 4” and “4 March.” This can silently produce a wrong result rather than an obvious error. Using four-digit years and, where possible, an unambiguous format like YYYY-MM-DD reduces the risk.

Error 6: The age doesn’t update

If a formula uses a fixed date rather than TODAY(), it will never update on its own — which is sometimes exactly what’s wanted (for archival records), but is a common source of confusion when someone expects a “live” age.

Error 7: Years, months, and days don’t add up correctly

This comes back to the “MD” limitation discussed earlier. <cite index=”6-1″>The “MD” argument may result in a negative number, a zero, or an inaccurate result</cite> in some date combinations. If the days figure looks wrong, it’s worth checking that specific date pair against the direct-subtraction alternative shown earlier in this guide.

How to Format Dates Correctly in Excel

A date’s format controls how it’s displayed — Short Date, Long Date, or a custom format — but not the underlying serial-number value Excel uses for calculations. That distinction matters because two dates can look identical on screen while one is a genuine Excel date and the other is text that merely resembles one; only the genuine date will work correctly inside DATEDIF.

Where possible, favor four-digit years and an unambiguous format such as YYYY-MM-DD, particularly in spreadsheets that might be opened by someone using different regional settings. Short Date and Long Date formats are fine for display purposes, but they don’t change how the date is stored — only how it’s shown.

How to Calculate Age in Excel From a Separate Day, Month, and Year

Sometimes a date of birth arrives split across three separate cells rather than as a single date:

DayMonthYear
1541995

To turn that into a usable date, combine the three cells with the DATE function:

=DATE(C2,B2,A2)

DATE takes year, month, and day (in that order) and returns a proper Excel date value, which can then be used directly inside an age formula:

=DATEDIF(DATE(C2,B2,A2),TODAY(),"Y")

This avoids the need for a separate helper column, though adding one (with the DATE formula in its own cell) can make a spreadsheet easier to audit if several other formulas will reference the same combined date.

How to Create a Simple Age Calculator in Excel

A compact, reusable layout for a one-person age calculator:

  • Date of Birth: (input cell, e.g. B2)
  • Age As Of: (input cell, e.g. B3 — or leave blank and use TODAY() instead)
  • Age in Years: =DATEDIF(B2,B3,"Y")
  • Age in Months: =DATEDIF(B2,B3,"YM") (remaining months after the years)
  • Age in Days: =DATEDIF(B2,B3,"MD") (remaining days, with the caveats discussed above)

Once built, this becomes a reusable template — change the date of birth or the as-of date, and every output updates instantly. It’s a genuinely useful pattern for HR records, school forms, or anywhere the same age calculation needs to be run repeatedly for different people.

How to Calculate Age in Excel for a List of Employees or Students

The same formulas scale cleanly to full datasets — employee rosters, class lists, membership databases, or event registrations, wherever a date of birth column already exists.

Employee NameDate of BirthAge as of Review Date
=DATEDIF([DOB],[ReviewDate],"Y")

One practical note worth flagging: spreadsheets containing birth dates alongside names are personal data. If a workbook like this needs to be shared, exported, or emailed, it’s worth considering whether every recipient genuinely needs to see full birth dates, or whether a computed age column alone would serve the purpose with less exposure of personal information.

How to Calculate Age in Excel Using an Excel Table

Converting a range into a formal Excel Table (select the range, then Insert > Table) has one particularly useful side effect for age calculations: a formula entered in one row of a Table column automatically fills into every row of that column, including new rows added later. That removes the need to manually drag a fill handle down every time a new person is added to the list — the age formula simply keeps up with the data.

Excel Age Calculation vs an Online Chronological Age Calculator

Excel is the right tool when you already have — or are building — a spreadsheet with more than a handful of records: employee lists, school rosters, research datasets, anything where the birth dates already live in a workbook and you want ages calculated alongside them.

For a single, quick calculation — checking one person’s exact age right now, or their age on a specific past or future date — a dedicated online chronological age calculator skips the formula-building step entirely. Enter a date of birth, optionally change the “as of” date, and the result appears immediately in years, months, and days, without needing to remember DATEDIF’s syntax or troubleshoot a #NUM! error.

Related Age Calculations You Can Do

A few related tools are useful depending on exactly what you’re trying to work out:

  • Need the gap between two people’s ages rather than a single person’s age? An age difference calculator handles that directly.
  • Just want to know how many days remain until a birthday? A birthday calculator covers that specific question.
  • Need the raw gap between any two dates — not necessarily birth-related — in years, months, weeks, or days? A date difference calculator is built for exactly that.
  • Trying to work out a U.S. Social Security full retirement age from a date of birth? There’s a dedicated retirement age calculator for that.
  • Want to quickly check whether a particular year is a leap year, relevant to the February 29 discussion above? A leap year calculator answers that in one click.
  • The full set of tools, including all of the above, is listed on the calculators page.

Excel Age Formula Cheat Sheet

GoalFormulaResult
Completed years (today)=DATEDIF(A2,TODAY(),"Y")Age in whole years
Completed years (specific date)=DATEDIF(A2,B2,"Y")Age in whole years as of a chosen date
Remaining months after years=DATEDIF(A2,TODAY(),"YM")Extra completed months
Remaining days after months=DATEDIF(A2,TODAY(),"MD")Extra days (verify against the caveats above)
Age without DATEDIF=YEAR(TODAY())-YEAR(A2)-IF(DATE(YEAR(TODAY()),MONTH(A2),DAY(A2))>TODAY(),1,0)Age in whole years, using only fully supported functions
Combine day/month/year cells into a date=DATE(C2,B2,A2)A proper date value from split cells

DATEDIF Units Reference

UnitMeaningTypical use
“Y”Complete years between the two datesStandard completed-age calculation
“M”Complete months between the two datesTotal months of tenure, duration, etc.
“D”Complete days between the two datesTotal day-count durations
“YM”Remaining months, ignoring yearsThe “months” part of a years+months+days age
“MD”Remaining days, ignoring months and yearsThe “days” part — use with caution, per Microsoft’s own warning
“YD”Remaining days, ignoring yearsComparing month/day position across different years

Frequently Asked Questions

How do I calculate age in Excel from date of birth? Use =DATEDIF(A2,TODAY(),"Y"), where A2 holds the date of birth. This returns the person’s current completed age in years.

What is the Excel formula for calculating age? The most common formula is =DATEDIF(start_date,end_date,"Y"). Replace end_date with TODAY() for a live, auto-updating age, or with a fixed date for age as of a specific point in time.

Can Excel automatically calculate age? Yes — using TODAY() as the end date in a DATEDIF formula means the result recalculates automatically every time the workbook is opened or refreshed, with no manual updating needed.

How do I calculate age using DATEDIF? =DATEDIF(A2,TODAY(),"Y") for years, =DATEDIF(A2,TODAY(),"YM") for remaining months, and (with caution) =DATEDIF(A2,TODAY(),"MD") for remaining days.

How do I calculate age in years, months, and days in Excel? Combine all three DATEDIF units: =DATEDIF(A2,TODAY(),"Y")&" years, "&DATEDIF(A2,TODAY(),"YM")&" months, "&DATEDIF(A2,TODAY(),"MD")&" days". Just be aware of the documented limitations of the “MD” unit covered earlier in this guide.

Why is my Excel age calculation one year off? This almost always means a plain YEAR(TODAY())-YEAR(A2) subtraction is being used instead of DATEDIF’s “Y” unit (or the equivalent corrected YEAR/MONTH/DAY formula), so the birthday-not-yet-reached case isn’t being accounted for.

How do I calculate age as of a specific date in Excel? Replace TODAY() with a fixed date: =DATEDIF(A2,B2,"Y"), where B2 holds the as-of date. The as-of date must be on or after the birth date, or the formula returns #NUM!.

Can I calculate age for multiple people in Excel? Yes — enter the formula once, then fill it down the column, or convert the range into an Excel Table so new rows pick up the formula automatically.

How do I calculate age if I only know the birth year? Excel can’t return an exact completed age from a year alone, since it has no month or day to compare against the current date. The result can only be an estimate, or a range of two possible ages, depending on whether the birthday has occurred yet this year.

How does Excel handle February 29 birthdays? DATEDIF’s day-count arithmetic still works correctly for leap-day birth dates. Whether a February 29 birthday is treated as falling on February 28 or March 1 in a non-leap year is a matter of convention (and sometimes law), and should be checked against the relevant authority if a legal age threshold is involved.

Why does DATEDIF return #NUM!? This happens when the start date is later than the end date — check that your date of birth and your “as of” date (or TODAY()) haven’t been swapped in the formula.

Is there an alternative to DATEDIF for calculating age? Yes: =YEAR(TODAY())-YEAR(A2)-IF(DATE(YEAR(TODAY()),MONTH(A2),DAY(A2))>TODAY(),1,0) produces the same result using only fully documented, supported Excel functions, at the cost of being longer to read.

Conclusion

For most everyday needs, =DATEDIF(A2,TODAY(),"Y") is the practical starting point for calculating age in Excel — it’s short, it updates automatically, and it correctly handles the birthday-not-yet-reached case that trips up a plain year subtraction. Layer in “YM” for remaining months and, with appropriate caution around its documented limitations, “MD” for remaining days, and you can build a full years/months/days age breakdown. Swap TODAY() for a fixed date whenever you need someone’s age as of a particular point in time rather than right now, and use an Excel Table when you’re calculating age across a whole list of people so new entries pick up the formula automatically.

Excel is especially useful when age calculations need to happen across many records at once — rosters, employee lists, research data — rather than one at a time. If you just need a single, quick answer without opening a spreadsheet at all, a chronological age calculator will give you the same years/months/days breakdown instantly from a date of birth.