To get an exact age in years, months, and days from a date of birth, Excel's DATEDIF function with the "Y", "YM", and "MD" units — wrapped together in one formula — returns the same answer a trusted calendar library would, and a free Age Calculator in the browser returns the same answer the moment you type a date. The reason age math trips people up in Excel is that three different approaches (DATEDIF, YEARFRAC, and the popular =INT((TODAY()-A2)/365.25) shortcut) all look reasonable and all return different numbers. They differ because each one answers a different question: full elapsed units, fractional years, or plain day count. Real age — the kind you put on a form, in a milestone, or in a personnel record — is full years, leftover full months, and remaining days counted in that order. The wrong order is what produces "negative days" when a birth day is on the 31st and the target month only has 30 days, or when someone born on February 29 asks about a common year. The rest of this article walks through the Excel formulas that actually work, the ones that quietly break, and a browser-based Age Calculator you can use to verify any result.

Excel Formulas That Return Real Age from a Date of Birth
Three Excel functions actually count age from a date of birth. Each returns a different unit, and picking the wrong one for the question you need to answer is how off-by-one errors creep into spreadsheets that otherwise look correct.
DATEDIF is the dedicated age function. Microsoft kept it in Excel for backward compatibility with Lotus 1-2-3, which is why it never appears in the formula autocomplete. It takes a start_date, an end_date, and a "unit" code: "Y" for full years, "M" for full months, "YM" for months after the last full year, "MD" for days after the last full month, and "D" for total days. Because each call returns one unit, you call DATEDIF three times and concatenate the parts to get years, months, and days in one cell.
YEARFRAC returns a decimal — the fraction of a year between two dates, based on the day-count convention you select (the default is basis 0, which uses the US 30/360 method and is the wrong choice for birthdays). With basis=1 (actual/actual), =YEARFRAC(A2, TODAY()) returns a person's age in years as a number, useful for multiplying by an annual figure such as an insurance premium or a benefit multiplier, but not for displaying "how old is this person" on screen.
The third option is the shortcut most users find on forums: =INT((TODAY()-A2)/365.25). It divides elapsed days by 365.25 to absorb the leap-year offset and chops off the decimal. It looks fine for the first year of life, then drifts — at age 8 the answer is already off by a few weeks, and across decades of leap-year irregularities the gap widens. The table below sets out what each formula really gives you.
| Formula | Unit returned | Best for | Main catch |
|---|---|---|---|
| =DATEDIF(A2, TODAY(), "Y") | Full completed years | Eligibility age, milestone years | Drops the months and days |
| =DATEDIF(A2, TODAY(), "M") | Full completed months | Babies and toddlers counted in months | Drops the years digit |
| =YEARFRAC(A2, TODAY(), 1) | Decimal years | Multiplying an annual figure by age | Default basis is wrong for birthdays |
| =INT((TODAY()-A2)/365.25) | Approximate years | Quick mental shortcut | Drifts — 365.25 ≠ real year length |
For years, months, and days in one cell, only DATEDIF gives an answer that won't surprise you next year. The section below shows the exact working formula.
Why =INT((TODAY()-A2)/365.25) Quietly Breaks at Month End
The shortcut formula is right about how many days you've been alive, then wrong about what "age" actually means. Excel counts every day between the date of birth and TODAY() — that's accurate. Dividing by 365.25 is meant to absorb the leap-year offset, but two things still go wrong.
First, the leap-year correction is approximate. Real leap years follow the Gregorian rule: a year is a leap year if divisible by 4, except century years, which must also be divisible by 400 — so 2000 was a leap year but 1900 and 2100 are not. The 365.25 figure assumes exactly one leap year every four years with no exceptions, so the formula drifts by one day every century. By age 50 the answer has already drifted measurably from the true birthday count
Second, the formula doesn't know what a birthday is. It treats every 365.25-day chunk as interchangeable, ignoring that a person born on March 31 is "0 years old" for the entire first day of life, becomes "1 year old" on March 31 of the next year, and so on. Crossing month boundaries is where this matters most. A person born on January 31 is not 1 month old on February 31 — that date doesn't exist. Real age math borrows from February's true length, which is 28 days most years and 29 in a leap year, and lands on February 28 or February 29. Apply that rule and January 31 → March 1 is exactly one month and one day, not zero months and twenty-nine days.
If you were born on February 29, the problem is starker — your actual birthday only exists one year in four. Across much of Europe and in many legal systems, your birthday is observed on February 28 in common years, so you still gain a full year every year instead of only once every four. A naively written Excel formula that increments only on real February 29s would mark you as a year older than you really are for three out of every four years.
The way DATEDIF and the Age Calculator avoid all of this is by stepping forward from the birth date: add whole years until one more would pass the target date, then add whole months until one more would pass, then count the days that remain. When the current day is earlier in the month than the birth day, the calculation borrows a month and adds that month's real length — 28, 29, 30, or 31 days, never a fixed 30. Working in that order keeps every value non-negative and matches the way age is stated on IDs and official forms.
Set Up DATEDIF for Years, Months, and Days in One Cell
This is the working formula. It assumes cell A2 holds a real Excel date (not text) and that today is your reference.
- Click an empty cell next to your dates of birth — say C2 — to hold the age string.
- Type = to start the formula.
- Type DATEDIF(, then click A2 to insert the date of birth, then type a comma.
- Type TODAY(), which fills in the current date automatically each time the workbook opens or recalculates.
- Type ,"Y") to close the first DATEDIF — this returns the full completed years.
- Add & " years, " & and then call DATEDIF(A2, TODAY(), "YM") to get the leftover months after the last full year.
- Add & " months, " & and then call DATEDIF(A2, TODAY(), "MD") to get the days left after the last full month.
- Add & " days" and press Enter.
The complete formula in C2 looks like this:
=DATEDIF(A2, TODAY(), "Y") & " years, " & DATEDIF(A2, TODAY(), "YM") & " months, " & DATEDIF(A2, TODAY(), "MD") & " days"
Worked example: if A2 holds the date March 15, 1990 and today's date is March 10, 2026, the formula returns "35 years, 11 months, 23 days". You can verify this by stepping forward from March 15, 1990 — 35 full years lands on March 15, 2025; from there, 11 more months lands on February 15, 2026; the remaining 23 days run from February 15, 2026 to March 10, 2026, crossing from February into March. The expression uses each month's real length and never produces a negative number, which is what makes it agree with any correctly written age calculator.
If you only want the age in completed years, replace the formula with =DATEDIF(A2, TODAY(), "Y"). If you want it in total months for a baby or for a form that asks for age in months, use =DATEDIF(A2, TODAY(), "M"). Both wrap the same DATEDIF call with a different unit. For a quick walkthrough of a one-line version of this idea, the guide Excel age from date of birth in a quick formula shows a few smaller variants.
Same Result Without a Spreadsheet: Use the Age Calculator
Sometimes there is no spreadsheet handy — you're looking at a paper ID, a passport stamp, or a single date-of-birth field in a form. The Age Calculator returns the same years, months, and days breakdown with no formulas to write and no columns to set up.
To use it, open the Age Calculator in any browser. Pick your date of birth in the first field by clicking the calendar icon or typing the date directly — your exact age appears the moment a valid date is entered, with no button to press. The second field defaults to today, which is what you want when the question is "how old am I right now". To check an age at a different point in time, change the second field to any past date (your age on the day a document was signed, for example) or any future date (your age on a planned event). The result updates as soon as the second field changes.
Beside the years, months, and days, the tool also shows your age in total whole months, total weeks, and total days — useful when a form asks for age in weeks (common for infants) or when you need a day count for an anniversary or insurance question. There's also a live countdown to your next birthday, so you can tell at a glance how many days stand between today and the next occasion.
What the tool does internally is the same arithmetic described in the Excel section: full years first, leftover full months next, then remaining days. When the current day is earlier in the month than the birth day, it borrows a month and adds that month's real length — 28, 29, 30, or 31 days, never a fixed 30 — so the breakdown stays non-negative and consistent. Everything runs in your browser, so the date of birth never leaves your device; you can close the tab and reopen it without ever having signed up for anything.
If you'd rather skip writing the formula at all, the Age Calculator tool gives the same years, months, and days plus a totals panel and a next-birthday countdown, with no setup needed.
Excel vs. Browser Tool: Pick the Right One for the Job
Both approaches give the same years, months, and days — the difference is context. The decision depends on whether you have a spreadsheet open and on whether you're checking one age or filling many rows.
| If you need… | Use Excel with DATEDIF | Use the Age Calculator |
|---|---|---|
| Age for dozens or hundreds of rows in one workbook | Fill the formula down after setting it once | Slow — you'd type every date by hand |
| One-off check for a single date of birth | Setup time is longer than the answer | Type the date, read the result immediately |
| Age on a custom reference date, past or future | Swap TODAY() for a cell that holds the reference date | Change the second date field |
| Privacy-sensitive date of birth | Stays on your machine if the file is local | Runs in-browser, never uploaded anywhere |
| Total weeks for a baby under 12 months | Wrap DATEDIF with "D" and divide by 7 | Already shown beside the years breakdown |
| Cross-check a freshly written formula | Side-by-side cell comparison works | Faster — type the same date once and read |
The two are complements, not competitors. Build the DATEDIF formula for any workbook that holds more than a handful of dates of birth — it scales to thousands of rows with a single fill-down. Open the Age Calculator for one-off checks, for verifying a fresh formula before you trust it, and for situations where Excel isn't in front of you. The arithmetic they share — full years first, leftover full months next, remaining days last, with each month borrowing its real length — is what lets them agree to the day.
Related reading: How to Calculate Day Number of Year in Excel: Formula.