Whether it’s an employee list, a student register or a customer database, you’ll often need to turn a date of birth into an age. Excel can do it in one formula, and the age updates automatically every day.
Quick answer
With the date of birth in B2:
=DATEDIF(B2,TODAY(),"Y")
This returns the age in complete years. Copy it down the column for the whole list.
Method 1: DATEDIF (most common)
DATEDIF(start_date, end_date, unit) counts the difference between two dates. It’s a “hidden” function: Excel won’t suggest it as you type, but it works in all versions and in Google Sheets.
| Unit | Returns | Example result |
|---|---|---|
"Y" |
Complete years | 34 |
"M" |
Complete months | 415 |
"D" |
Days | 12,640 |
"YM" |
Months after the complete years | 7 |
"MD" |
Days after the complete months | 12 |
Note: the start date must be earlier than the end date, or you’ll get #NUM!.
Method 2: YEARFRAC
=INT(YEARFRAC(B2,TODAY(),1))
YEARFRAC returns the fraction of years between two dates (for example 34.6). INT drops the decimals. The last argument 1 tells Excel to use actual days, which handles leap years correctly. Want one decimal instead? Use =ROUND(YEARFRAC(B2,TODAY(),1),1).
Avoid the shortcut =(TODAY()-B2)/365. It ignores leap years and can be a day or two wrong around birthdays.
Age in years, months and days
=DATEDIF(B2,TODAY(),"Y")&" years, "&DATEDIF(B2,TODAY(),"YM")&" months, "&DATEDIF(B2,TODAY(),"MD")&" days"
Result: 34 years, 7 months, 12 days. In Microsoft 365 you can make it shorter with LET:
=LET(d,B2,t,TODAY(),DATEDIF(d,t,"Y")&" years, "&DATEDIF(d,t,"YM")&" months")
Microsoft notes that the "MD" unit can give odd results in some month-end cases, so for official documents years and months are usually enough.
Age on a specific date
Replace TODAY() with a date cell. For example, age at the start of the school year in cell E1:
=DATEDIF(B2,$E$1,"Y")
The $ signs keep E1 fixed when you copy the formula down. See absolute vs relative references. Or type the date directly: =DATEDIF(B2,DATE(2026,9,1),"Y").
Days until the next birthday
=DATE(YEAR(TODAY())+(DATE(YEAR(TODAY()),MONTH(B2),DAY(B2))<TODAY()),MONTH(B2),DAY(B2))-TODAY()
It builds this year’s birthday, moves it to next year if it has already passed, and subtracts today. Format the result as a number, not a date.
To highlight birthdays this month, use conditional formatting with =MONTH($B2)=MONTH(TODAY()). More ideas in conditional formatting examples.
Group people by age band
=IFS(C2<25,"Under 25",C2<35,"25-34",C2<45,"35-44",TRUE,"45+")
Where C2 contains the age. Then count each band with COUNTIFS or a PivotTable.
Common problems
- #VALUE!: the date of birth is stored as text. Convert it with Data ā Text to Columns ā Finish, or
=DATEVALUE(B2). - The result looks like a date: change the cell format to General or Number.
- Wrong day/month order: 03/04/1990 may be read as March 4 instead of 3 April. Check your regional date format.
- Blank rows show a huge age: wrap it:
=IF(B2="","",DATEDIF(B2,TODAY(),"Y"))
More date tricks in Excel date functions.
FAQ
What is the formula to calculate age in Excel?
=DATEDIF(B2,TODAY(),”Y”) where B2 holds the date of birth. It returns complete years and updates every day.
Why can’t I find DATEDIF in Excel?
DATEDIF is an older function that Excel doesn’t list in autocomplete, but it still works. Type it in full.
How do I calculate age in Google Sheets?
The same way: =DATEDIF(B2,TODAY(),”Y”) works in Google Sheets.
How do I calculate age at a specific date?
Replace TODAY() with the date or a cell that holds it, for example =DATEDIF(B2,DATE(2026,12,31),”Y”).