How to Calculate Age in Excel and Google Sheets
You have a column of birth dates and you need everyone’s age, for a class list, a staff record or an eligibility check. The quick fix most people try, subtracting dates and dividing by 365, gets some ages wrong. This guide shows the formulas that give exact ages in Excel and Google Sheets, how to get years, months and days, how to calculate age on a specific date, and how to fix the errors people hit most often.
The Quick Answer: Age in Years
With a date of birth in cell A2, this formula returns the person’s age in completed years today:
=DATEDIF(A2,TODAY(),"Y")
DATEDIF counts the full years between two dates, so it only adds a year once the birthday has passed. It works the same way in Excel and Google Sheets.
Only need one age? Skip the spreadsheet and get an exact answer in seconds.
Use the age calculatorWhy Dividing by 365 Gives Wrong Ages
The shortcut =INT((TODAY()-A2)/365) looks sensible, but leap years add an extra day every four years. Over a lifetime those extra days push the result past a birthday before it actually happens.
Example: someone born on November 21, 2000, checked on November 20, 2026, has lived 9,495 days. Dividing by 365 gives 26.01, so the formula says 26, but their birthday is tomorrow and they are still 25. DATEDIF gets this right.
How to Calculate Age in Years, Months and Days
Years, Months and Days in Separate Cells
| What you want | Formula (birth date in A2, end date in B2) |
|---|---|
| Completed years | =DATEDIF(A2,B2,"Y") |
| Months after the last birthday | =DATEDIF(A2,B2,"YM") |
| Days after the last full month | =B2-EDATE(A2,DATEDIF(A2,B2,"M")) |
For today’s age, put =TODAY() in B2, or replace B2 with TODAY() in each formula.
Why Not Use DATEDIF “MD” for Days?
DATEDIF also has an “MD” option for the leftover days, but Microsoft warns that “MD” can return a negative number, a zero or an inaccurate result. The EDATE formula in the table above avoids that problem: it finds the date of the last full month and counts the days after it.
Everything in One Cell
=DATEDIF(A2,B2,"Y")&" years, "&DATEDIF(A2,B2,"YM")&" months, "&B2-EDATE(A2,DATEDIF(A2,B2,"M"))&" days"
This returns text such as “31 years, 6 months, 12 days”. Use the separate formulas instead if you need to sort or filter by age.
How to Calculate Age on a Specific Date
Forms often ask for age on a cut-off date, not today. Replace TODAY() with the cut-off date:
- From a cell:
=DATEDIF(A2,$C$1,"Y"), with the cut-off date in C1. The dollar signs keep C1 fixed when you copy the formula down. - Typed into the formula:
=DATEDIF(A2,DATE(2027,9,1),"Y")for age on September 1, 2027.
This is the method schools use for admission cut-offs. See our guide to kindergarten age cutoffs by state for the dates that apply in the US.
Age in Months, Weeks or Days
| Unit | Formula |
|---|---|
| Total months | =DATEDIF(A2,B2,"M") |
| Total days | =B2-A2 (format the cell as a number) |
| Total weeks | =INT((B2-A2)/7) |
Calculating Age in Google Sheets
Google Sheets supports the same DATEDIF function, plus TODAY, EDATE and DATE, so every formula on this page works without changes. One difference to watch: Sheets reads typed dates using your spreadsheet’s locale, set under File > Settings. A US locale reads 04/05/2027 as April 5, while a UK locale reads it as 4 May.
Common Errors 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 birth dates are in the future.
#VALUE! Error
The date is stored as text. Re-enter it, or convert it with =DATEVALUE(A2), and check that the cell is formatted as a date.
Wrong Results After Copying the Formula
If the cut-off date moves when you copy down, lock it with dollar signs, such as $C$1.
DATEDIF Doesn’t Appear in Excel’s Suggestions
DATEDIF is an older function kept for compatibility, and Excel may not suggest it as you type. Type the full name; it still works.
Very Old Dates
Excel’s standard date system starts on January 1, 1900, so it can’t calculate with earlier dates. For older family history records, use the age calculator instead.
Calculating Ages for a Whole List
- Put birth dates in column A, starting in A2.
- Put the date you need ages for in C1, or use TODAY().
- In B2, enter
=DATEDIF(A2,$C$1,"Y"). - Double-click the fill handle (the small square at the bottom right of B2) to copy it down the list.
Checking ages for a test or assessment? Get the exact years;months;days format with the right borrowing method.
Open the chronological age calculatorExcel Age Formula FAQs
What is the formula to calculate age in Excel?
=DATEDIF(A2,TODAY(),"Y"), with the date of birth in A2. It returns completed years.
How do I calculate age as of a specific date in Excel?
Replace TODAY() with the date, for example =DATEDIF(A2,DATE(2027,9,1),"Y").
How do I get age in years and months in Excel?
Use =DATEDIF(A2,TODAY(),"Y") for years and =DATEDIF(A2,TODAY(),"YM") for the extra months.
Does DATEDIF handle leap years?
Yes. It counts real calendar years and months, so leap days are handled correctly.
Is YEARFRAC better than DATEDIF for age?
YEARFRAC returns a fraction of a year, which is useful for finance but less direct for age. For a whole-number age, DATEDIF with “Y” is the clearest choice.