How To Calculate Age From A Birth Date In Excel (2026)
The quickest way to get someone’s age in Excel is the DATEDIF function with TODAY.
Type the birth date in one cell, put one formula next to it, and Excel returns the number of full years.
This guide uses Microsoft’s support pages and shows the other age methods they document too.
Table of Contents
- Quick answer
- Enter the birth date correctly
- Calculate age in years with DATEDIF
- DATEDIF unit codes
- Show years and months together
- How TODAY changes the answer
- Other age formulas from Microsoft
- Get a decimal age with YEARFRAC
- Fill the formula down a list of people
- Calculate age on a specific date
- Count months, weeks and days instead of years
- Find a date a set number of months away
- Count working days between two dates
- Which method should you use
- Fix common age errors
- Related Excel guides
- Official sources
- More Word, Excel and PowerPoint guides
Quick answer
| You want | Formula | Notes |
|---|---|---|
| Age in full years today | =DATEDIF(A2,TODAY(),"y") | A2 holds the birth date |
| Age on a set date | =DATEDIF(A2,B2,"y") | B2 holds the end date |
| Months left after the last full year | =DATEDIF(A2,TODAY(),"ym") | Use with the years formula |
| Age as a decimal | =YEARFRAC(A2,TODAY(),1) | Basis 1 is actual/actual |
| Whole days lived | =DAYS(TODAY(),A2) | Microsoft shows this form with a fixed date |
Enter the birth date correctly
Excel stores dates as serial numbers, with January 1, 1900 as serial 1.
Type the date in your regional format, such as 6/3/2002 in a US setup, and check that it right-aligns in the cell.
Microsoft warns that text dates can cause problems with YEARFRAC, so use real dates or the DATE function.
If a date appears as a number or hash marks, read our date display fix.
Calculate age in years with DATEDIF
DATEDIF takes a start date, an end date and a unit code in quotation marks.
- Type the birth date in A2.
- Click B2.
- Type
=DATEDIF(A2,TODAY(),"y")and press Enter. - Format B2 as General or Number if it shows as a date.
The “y” code returns the number of full years between the two dates.
Microsoft notes that DATEDIF exists to support older workbooks from Lotus 1-2-3.
DATEDIF unit codes
| Code | Returns | Use for age |
|---|---|---|
| “y” | Full years between the dates | Yes |
| “m” | Full months between the dates | Total months old |
| “d” | Full days between the dates | Total days old |
| “ym” | Months left after the last full year | Yes, for years and months |
| “md” | Days left after the last full month | Microsoft does not recommend it |
Microsoft says the “md” argument may calculate inaccurate results, so avoid it for anything important.
Show years and months together
Join two DATEDIF formulas with the ampersand to build a readable age.
Type =DATEDIF(A2,TODAY(),"y")&" years, "&DATEDIF(A2,TODAY(),"ym")&" months" in B2.
Microsoft builds a similar combined result, showing “2 years, 4 months, 5 days” in its example.
For the days part, its page subtracts the first day of the end date’s month from the end date using DATE(YEAR(end),MONTH(end),1).
Microsoft advises you to verify the day count before relying on it.
How TODAY changes the answer
TODAY returns the serial number of the current date and takes no arguments.
Results change when you reopen the file on a later day, because Excel uses the computer’s date.
If the date does not update, set Calculation Options to Automatic on the Formulas tab.
Use a fixed end date in place of TODAY() when you need a report to stay the same.
Other age formulas from Microsoft
| Formula | What it does | Caution |
|---|---|---|
=YEAR(NOW())-YEAR(A2) | Subtracts the birth year from the current year | Ignores whether the birthday has passed |
=YEAR(NOW())-1960 | Age of someone born in 1960 without a cell reference | Same limit as above |
=YEARFRAC(A3,A5) | Fraction of a year between two dates | Default basis is US 30/360 |
=(A5-A6)/365.25 | Years between two dates, allowing for leap years | Microsoft’s example returns 12.08 |
=DAYS(TODAY(),"2/15/79") | Days from a date to today | Result depends on today’s date |
The first two rows only subtract years, so they can be a year off before the birthday arrives.
Get a decimal age with YEARFRAC
YEARFRAC uses YEARFRAC(start_date, end_date, [basis]).
| Basis | Day count method |
|---|---|
| 0 or omitted | US (NASD) 30/360 |
| 1 | Actual/actual |
| 2 | Actual/360 |
| 3 | Actual/365 |
| 4 | European 30/360 |
Microsoft’s example from 1/1/2012 to 7/30/2012 returns 0.58055556 by default and 0.57650273 with basis 1.
An invalid date returns #VALUE!, and a basis below 0 or above 4 returns #NUM!.
Fill the formula down a list of people
Enter each birth date in column A, then put the DATEDIF formula in the first row of column B.
Drag the fill handle down so Excel adjusts the row reference for each person.
Keep the TODAY() part as it is, because it has no cell reference to change.
Calculate age on a specific date
Put the target date in its own cell, such as B1, and use it as the end date.
Type =DATEDIF(A2,$B$1,"y") so every row compares against the same date.
This works for a cut-off date, such as an event or school year, because the answer no longer depends on today’s date.
The result is #NUM! if the birth date is later than the date in B1.
Count months, weeks and days instead of years
| Result | Formula | Source note |
|---|---|---|
| Full months | =DATEDIF(A2,TODAY(),"m") | The “m” code returns full months |
| Full days | =DATEDIF(A2,TODAY(),"d") | The “d” code returns full days |
| Weeks | =DATEDIF(A2,TODAY(),"d")/7 | Microsoft divides days by 7 and formats to two decimals |
| Months using years | =(YEAR(NOW())-YEAR(A2))*12+MONTH(NOW())-MONTH(A2) | Microsoft’s month-count formula |
Format the result cell as Number with two decimal places to see weeks like 122.29, as in Microsoft’s example.
Find a date a set number of months away
EDATE moves a date by a number of months, which is handy for milestone ages.
Microsoft’s example =EDATE(A3,-4) returns the date four months earlier.
Apply a date format to the cell, because EDATE returns a serial number.
Count working days between two dates
NETWORKDAYS counts whole working days and can skip a list of holidays.
Microsoft’s example =NETWORKDAYS(A3,A2,A3:A5) returns 107 for its sample dates.
Use it for tenure or service length rather than age.
Which method should you use
| Situation | Best choice | Why |
|---|---|---|
| Records, forms and HR sheets | DATEDIF with “y” | Returns whole years, the way ages are normally stated |
| Finance or accrual work | YEARFRAC with a chosen basis | You control the day count method |
| Quick estimate | (end date – start date)/365.25 | The 365.25 allows for leap years |
| Accounting on a 360-day year | DAYS360 | Microsoft’s example returns 570 for its sample dates |
When in doubt, test the formula with a birth date you know and compare the answer to your own count.
Check one date near a birthday as well, since that is where year-only formulas go wrong.
Fix common age errors
| Problem | Cause | Fix |
|---|---|---|
| #NUM! | The start date is later than the end date | Put the birth date first and the later date second |
| #VALUE! | A date is typed as text | Re-enter it as a real date or with DATE |
| Age shows as a date | Cell has a date format | Switch the cell to General or Number |
| Age does not update | Calculation is manual | Set Calculation Options to Automatic |
Related Excel guides
To count between any two dates, read How To Calculate Days Between Dates In Excel.
If formulas stay as text, see Excel formulas not calculating.
To turn an age into a percentage, try How To Calculate A Percentage In Excel.
Official sources
See Microsoft’s pages on calculating the difference between two dates, calculating age, the YEARFRAC function and the TODAY function.