Split First and Last Name in Excel — With Examples (TEXTSPLIT, LEFT, FIND)
Learn how to split first and last name in Excel: TEXTSPLIT, LEFT and FIND formulas, middle names, Flash Fill and Text to...
Read Guide →You have a date of birth, and you need the age — in whole years, and sometimes in years, months and days, and it has to stay correct as time passes. The simplest and most accurate formula is DATEDIF: it counts complete years from the birth date to today, and it drops the partial year instead of rounding it up. The catch is that Excel hides it — DATEDIF does not appear in autocomplete or the function wizard, so most people never find it and use a method that is wrong instead. This guide gives you the formula first, works it through on five birth dates including the birthday trap, and covers years-months-days, years of service, and the two methods to avoid.
Quick takeaway: DATEDIF is the simplest and most accurate method — and Excel hides it.
=DATEDIF(birth_date, TODAY(), "y") — the age in whole years, updating every day.=DATEDIF(birth_date, TODAY(), "y") & " years, " & DATEDIF(birth_date, TODAY(), "ym") & " months, " & DATEDIF(birth_date, TODAY(), "md") & " days" – the age in years, months and days.
=DATEDIF(A2, TODAY(), "y")
| Part | What it does |
|---|---|
A2 | The date of birth (the start date) |
TODAY() | The date to measure to (the end date) — use TODAY() so the age updates every day |
"y" | Count complete years |
DATEDIF counts anniversaries: how many birthdays fall on or before the end date. Partial years are dropped, never rounded up. If the start date is later than the end date, DATEDIF returns #NUM!.
Ages as of 24 November 2026, with =DATEDIF(A2, TODAY(), "y") in column B:
| A: Date of birth | B: Age | Why |
|---|---|---|
| 17 Aug 1968 | 58 | Birthday passed in August 2026 |
| 25 Dec 1990 | 35 | Birthday is 25 December — not yet reached |
| 29 Feb 2000 | 26 | Leap-day birthday; 2026 is not a leap year |
| 24 Nov 2000 | 26 | Birthday is today — the 26th birthday counts |
| 25 Nov 2000 | 25 | Birthday is tomorrow — still 25 |
Check the trap rows: 25 December 1990 gives 35, not 36 — the 36th birthday has not happened yet. 25 November 2000 gives 25, not 26 — the birthday is tomorrow. Subtracting the years alone gives 36 and 26 for both, which is wrong by one. That is the whole point of DATEDIF: it waits for the birthday.
For a full age — “36 years, 5 months, 10 days” — use three DATEDIF formulas together:
=DATEDIF(A2, TODAY(), "y") & " years, " & DATEDIF(A2, TODAY(), "ym") & " months, " & DATEDIF(A2, TODAY(), "md") & " days"
| Unit | What it counts |
|---|---|
"y" | Complete years |
"ym" | Complete months after the years (ignoring the years) |
"md" | Days after the months (ignoring the years and months) |
For a birth date of 14 June 1990, as of 24 November 2026, the result is 36 years, 5 months, 10 days: 14 June 1990 to 14 June 2026 is 36 years, 14 June to 14 November is 5 months, and 14 November to 24 November is 10 days. The full guide to the months between two dates is the months between dates guide.
The same formula calculates years of service from a hire date — just swap the birth date for the hire date:
=DATEDIF(hire_date, TODAY(), "y")
A hire date of 10 March 2021 gives 5 years of service as of 24 November 2026: the 5th anniversary was 10 March 2026, and the 6th is 10 March 2027. The same three-unit version gives the service in years, months and days.
Method 1: subtracting the years. =YEAR(TODAY()) - YEAR(A2) gives 36 for a birth date of 25 December 1990, but the true age is 35 — the birthday has not happened yet. It is wrong by one for everyone whose birthday is still to come this year. It is only right after the birthday has passed.
Method 2: dividing by 365.25. =INT((TODAY() - A2)/365.25) looks clever, but it can be wrong by a whole year. From 28 February 2013 to 28 February 2016 is exactly 3 years — 1,095 days. Divided by 365.25, that is 2.9979, and INT gives 2 instead of 3. The exact number of days in a year is 365.2422, so 365.25 is an approximation, and the approximation costs a whole year here. YEARFRAC has the same problem in decimal form: from 31 July 2012 to 30 July 2015 it gives about 2.995, not a clean 2 years and 364 days. For whole years, use DATEDIF. For a decimal number of years, YEARFRAC is the right tool — but do not wrap it in INT and call it an age.
| Mistake | What happens | Fix |
|---|---|---|
| You subtracted the years | Wrong by one until the birthday has passed | Use DATEDIF with “y” |
| You divided by 365.25 | Can be wrong by a whole year (2 instead of 3) | Use DATEDIF with “y” |
| You used INT(YEARFRAC(…)) for whole years | Same approximation error as 365.25 | Use DATEDIF with “y” |
| You used “m” instead of “ym” for the months part | The months count includes the years (59 instead of 5) | Use “ym” for months after the years |
| You used “d” instead of “md” for the days part | The days count includes the years and months | Use “md” for days after the months |
| Your start date is after the end date | #NUM! | Check the order — birth date first, TODAY() second |
| Your birth date is text, not a real date | #VALUE! | Convert it with DATEVALUE, retype it, or rebuild it with DATE |
| You typed DATEDIF and got no autocomplete | That is normal — DATEDIF is hidden | Type it anyway; it works in every version |
How do I calculate age in Excel from a date of birth? =DATEDIF(birth_date, TODAY(), "y"). For example, a birth date of 17 August 1968 gives 58 as of 24 November 2026. Use TODAY() as the end date so the age updates every day.
What is the DATEDIF formula for age? =DATEDIF(start_date, end_date, "y"). It counts complete years and drops the partial year. It does not appear in autocomplete or the function wizard, but it works in every version of Excel.
How do I calculate age in years, months and days in Excel? Use three DATEDIF formulas: “y” for complete years, “ym” for the months after the years, and “md” for the days after the months. For 14 June 1990, the result is 36 years, 5 months, 10 days.
Why is YEAR(TODAY()) − YEAR(birth date) wrong? It ignores the birthday. For a birth date of 25 December 1990, it gives 36, but the true age is 35 until 25 December 2026. DATEDIF waits for the birthday.
How do I calculate years of service in Excel? =DATEDIF(hire_date, TODAY(), "y"). A hire date of 10 March 2021 gives 5 years of service as of 24 November 2026.
Why does DATEDIF return #NUM!? The start date is later than the end date. Check the order — the birth date or hire date comes first, TODAY() second.
Is dividing by 365.25 a good way to calculate age? No. From 28 February 2013 to 28 February 2016 is exactly 3 years — 1,095 days — but 1,095 / 365.25 is 2.9979, and INT gives 2. Use DATEDIF for whole years.
That is how to calculate age in Excel: DATEDIF, with “y” for whole years, and “ym” and “md” for the months and days after them. The formula is the simplest and most accurate method, and the only reason most people miss it is that Excel hides it — no autocomplete, no function wizard, no hint that it exists. Remember the two things that matter: subtracting the years is wrong until the birthday has passed, and dividing by 365.25 can be wrong by a whole year. From here, the next date jobs to learn are the ones this formula is built on — the months between dates guide, the add months to date guide, and the day of week formula guide — and the full learning order for the whole site is on the Excel Formulas hub.
Learn how to split first and last name in Excel: TEXTSPLIT, LEFT and FIND formulas, middle names, Flash Fill and Text to...
Read Guide →Learn how to get the month and year from a date in Excel: month name, month number, quarter, first and last day...
Read Guide →Learn how to extract text after a character in Excel: TEXTAFTER and TEXTBEFORE, the last word, and the older FIND method.
Read Guide →