How to Calculate Age from Date of Birth in Excel
Calculate age from a birth date in Excel with DATEDIF or YEARFRAC, choose a fixed as-of date, and handle future or invalid dates safely.
Method 1: completed years with DATEDIF
=DATEDIF(A2,TODAY(),"Y") returns the number of complete years between the birth date and today. The "Y" unit excludes the unfinished year, so the result changes on the birthday rather than on January 1. Format the result cell as General or Number, not as a date.
For a report that must not change tomorrow, place the reporting date in E1 and use =DATEDIF(A2,$E$1,"Y"). Label E1 clearly as As of date. This makes payroll, eligibility, and historical reports reproducible; TODAY is appropriate only for a live dashboard where automatic change is intended. Total months are available with =DATEDIF(A2,$E$1,"M"), and an eligibility rule such as =IF(DATEDIF(A2,$E$1,"Y")>=18,"Adult","Minor") keeps the threshold visible in the formula. For the leftover months, =DATEDIF(A2,$E$1,"YM") returns the months after the last full year.
Method 2: decimal age with YEARFRAC
When an analysis needs an approximate age including part of the current year, use =YEARFRAC(A2,$E$1,1). Basis 1 uses actual days in actual years. Do not simply divide the day difference by 365, because leap years make that drift. Round only for display or according to a documented business rule.
Decimal age is not a substitute for completed age in policy decisions: 17.99 is still 17 completed years. State whether the requirement is completed years, decimal years, months, or days before choosing a formula.
Validate dates and exceptional cases
Excel stores recognized dates as serial numbers. A birth date imported as text can cause an error or an incorrect comparison; test with ISNUMBER and fix the import. Use DATEVALUE only when the text format is consistent and unambiguous, and prefer ISO-formatted imports over strings such as 03/04/05.
A future birth date makes DATEDIF return #NUM!. Flag it with =IF(A2>$E$1,"Check date",DATEDIF(A2,$E$1,"Y")). Error handling should communicate the data problem rather than silently convert every failure to zero. For a person born on February 29, ask the policy owner how a non-leap year is treated; DATEDIF counts the birthday as reached on March 1.
Common mistakes
Using =YEAR(TODAY())-YEAR(A2) overstates age before this year’s birthday. Using TODAY in an archived report makes past outputs change. Reversed arguments (end date first) give #NUM!, and DATEDIF is a compatibility function that Excel does not suggest while you type, although it works. Retain the as-of date beside exported results so the age can be interpreted later.
Your turn
In C2, calculate completed years from A2 to the as-of date in B2.
| A | B | C | |
|---|---|---|---|
| 1 | Birth date | As of | Age |
| 2 | 5/20/1990 | 4/1/2026 | |
| 3 | 1/15/2000 | 1/15/2026 | |
| 4 | 12/30/1985 | 12/29/2025 |
Answer: =DATEDIF(A2,B2,"Y")
Worked example
Birth dates in A and the as-of dates in B. The last person has a birthday tomorrow, so the age has not changed yet.
| A | B | |
|---|---|---|
| 1 | Birth date | As of |
| 2 | 1990-05-20 | 2026-04-01 |
| 3 | 2000-01-15 | 2026-01-15 |
| 4 | 1985-12-30 | 2025-12-29 |
| 5 | 2000-02-29 | 2025-02-28 |
| Formula | Result |
|---|---|
=DATEDIF(A2,B2,"Y") | 35 |
=DATEDIF(A2,B2,"YM") | 10 |
=YEAR(B2)-YEAR(A2) | 36 |
=DATEDIF(A3,B3,"Y") | 26 |
=DATEDIF(A4,B4,"Y") | 39 |
=DATEDIF(A5,B5,"Y") | 24 |
=IF(A2>B2,"Check date",DATEDIF(A2,B2,"Y")) | 35 |
Quick mistake checklist
- Subtracting year numbers without checking whether the birthday has occurred.
- Using
TODAYwhen the report needs a fixed as-of date. - Treating ambiguous text as a reliable date.
Frequently asked questions
Why is DATEDIF not suggested as I type?
DATEDIF is retained for compatibility and does not appear in the function list, but Excel supports the formula.
How do I calculate age on a specific date?
Store that date in a cell and use it as the second DATEDIF argument.
How do I return years and months?
Combine DATEDIF with "Y" for years and "YM" for remaining months, with clear labels.
Why does my age show as a date?
The result cell has a date number format. Change it to General or Number.
Practice the skill
Continue with a checked FormulaCamp lesson: Tenure, Deadlines, Weekdays
Open the lesson