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

You wantFormulaNotes
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.

  1. Type the birth date in A2.
  2. Click B2.
  3. Type =DATEDIF(A2,TODAY(),"y") and press Enter.
  4. 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

CodeReturnsUse for age
“y”Full years between the datesYes
“m”Full months between the datesTotal months old
“d”Full days between the datesTotal days old
“ym”Months left after the last full yearYes, for years and months
“md”Days left after the last full monthMicrosoft 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

FormulaWhat it doesCaution
=YEAR(NOW())-YEAR(A2)Subtracts the birth year from the current yearIgnores whether the birthday has passed
=YEAR(NOW())-1960Age of someone born in 1960 without a cell referenceSame limit as above
=YEARFRAC(A3,A5)Fraction of a year between two datesDefault basis is US 30/360
=(A5-A6)/365.25Years between two dates, allowing for leap yearsMicrosoft’s example returns 12.08
=DAYS(TODAY(),"2/15/79")Days from a date to todayResult 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]).

BasisDay count method
0 or omittedUS (NASD) 30/360
1Actual/actual
2Actual/360
3Actual/365
4European 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

ResultFormulaSource 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")/7Microsoft 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

SituationBest choiceWhy
Records, forms and HR sheetsDATEDIF with “y”Returns whole years, the way ages are normally stated
Finance or accrual workYEARFRAC with a chosen basisYou control the day count method
Quick estimate(end date – start date)/365.25The 365.25 allows for leap years
Accounting on a 360-day yearDAYS360Microsoft’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

ProblemCauseFix
#NUM!The start date is later than the end datePut the birth date first and the later date second
#VALUE!A date is typed as textRe-enter it as a real date or with DATE
Age shows as a dateCell has a date formatSwitch the cell to General or Number
Age does not updateCalculation is manualSet Calculation Options to Automatic

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.

Leave a Reply

Your email address will not be published. Required fields are marked *