Calculate Age From a Birth Date
The DATEDIF function counts complete years between two dates, which is exactly what an age is. Combine it with TODAY for the current age, or with any date to get the age on that day.
Free, no sign-up required · 5 free generations a day
Last updated
Describe your task, get the formula
Type what you need in plain English, or pick an example below. You get the formula, a step-by-step explanation, and a worked example.
Age formulas
=DATEDIF(birth_date, TODAY(), "Y")
=DATEDIF(birth_date, TODAY(), "YM")
=INT(YEARFRAC(birth_date, TODAY()))"Y" returns complete years and "YM" returns the months left over after the complete years. DATEDIF works in Excel and Google Sheets even though Excel does not list it in the function suggestions.
Examples
Age in complete years
=DATEDIF(A2,TODAY(),"Y")Counts the full years from the birth date in A2 to today. The result updates every day, so the age stays correct without editing the sheet.
Age in years and months
=DATEDIF(A2,TODAY(),"Y")&" years, "&DATEDIF(A2,TODAY(),"YM")&" months"Joins the complete years and the leftover months into one text label such as 34 years, 7 months.
Age on a specific date, with a label
=IF(DATEDIF(A2,B2,"Y")>=18,"Adult","Minor")Uses a reference date in B2, such as an event or an enrollment date, instead of today, and labels the person based on the result.
Common mistakes and how to fix them
#NUM! error
DATEDIF returns #NUM! when the start date is later than the end date. Check that the birth date comes first and that no date was entered with the wrong year.
The age is one year off
Dividing the number of days by 365 ignores leap years and drifts. Use DATEDIF with "Y", which counts complete calendar years.
Days left over give odd results
The "MD" unit, used to get leftover days, is known to return wrong or negative values in some Excel versions. Stop at years and months, or calculate days separately.
Frequently asked questions
Why doesn't DATEDIF appear when I type it?
It is a legacy function that Excel keeps for compatibility but leaves out of the suggestion list. It still works when you type it in full.
How do I calculate age as a decimal?
Use YEARFRAC, for example =YEARFRAC(A2,TODAY()), which returns something like 34.6. Wrap it in INT to drop the decimals.
Does it work in Google Sheets?
Yes. DATEDIF, TODAY, and YEARFRAC use the same syntax in Google Sheets.
Don't want to write it by hand?
Describe what you need in plain English and get a ready-to-use formula in seconds.
Try the formula generator