How to Calculate Age in Excel: Step-by-Step Guide
In this article
To calculate age in Excel, subtract the birth date from today's date and divide by 365.25, or use the DATEDIF function for whole years. The simplest working formula is =DATEDIF(A2, TODAY(), "Y"), where A2 holds the date of birth. That returns age in completed years and updates automatically whenever the workbook recalculates. The rest of this guide covers the exact steps, the pitfalls that make Excel return errors or wrong ages, and how to handle edge cases like leap years and future dates.
What You'll Need
- Excel for Microsoft 365, Excel 2021, Excel 2019, or Excel for Mac. The DATEDIF function works in all of them, though it is a legacy function and does not appear in the function list or autocomplete.
- A column of birth dates entered as real Excel dates, not text. Dates typed as 01/15/1990 are usually recognised automatically; dates typed as text (for example with an apostrophe or in an unrecognised format) will break the formula.
- A blank column next to the birth dates for the age result.
Step-by-Step
- Check that your dates are real dates. Click a birth date cell and look at the formula bar. If it shows the date (for example 1/15/1990), it is a real date. If it shows text or a number like 32874, it is stored differently. Real dates align to the right by default; text aligns left. If dates are text, select the column, go to Data > Text to Columns, click Finish, and Excel will often convert them. Alternatively, use DATEVALUE or retype them in a format Excel recognises.
- Pick an empty cell in the same row as the first birth date, for example B2 if the birth date is in A2. Type the formula =DATEDIF(A2, TODAY(), "Y") and press Enter. This returns the number of complete years between the birth date and today.
- Copy the formula down. Drag the fill handle (the small square at the bottom-right of the cell) down the column, or double-click it to fill to the last row of data. Each row now shows the age in whole years.
- Format the result as a number. If the cell shows a date instead of a number, right-click the cell, choose Format Cells, select Number, and set decimal places to 0.
- For age in months or days, change the third argument. Use "M" for complete months and "D" for days. For example =DATEDIF(A2, TODAY(), "M") gives total months lived. You can also combine them: =DATEDIF(A2,TODAY(),"Y") & " years, " & DATEDIF(A2,TODAY(),"YM") & " months" gives a readable age like "34 years, 5 months".
- Use a fixed date instead of TODAY() when you need age at a specific point. Replace TODAY() with a cell reference or a DATE function, for example =DATEDIF(A2, DATE(2025,1,1), "Y") for age on 1 January 2025. This is useful for school admission cut-offs or eligibility checks.
- Handle blank cells. If some birth date cells are empty, DATEDIF returns an error. Wrap the formula in IFERROR or IF: =IF(A2="","",DATEDIF(A2,TODAY(),"Y")) leaves the age blank until a date is entered.
- Verify one result manually. Pick a row and count the years between the birth date and today, checking whether the birthday has already passed this year. DATEDIF counts completed years, so someone born in December is one year younger in January than a simple year subtraction would suggest.
Common Mistakes
- Using (TODAY()-A2)/365.25 and expecting whole years. This gives a decimal age, not completed years. It is fine for statistical work but wrong for "how old is this person" answers. Round down with INT if you use it: =INT((TODAY()-A2)/365.25).
- Typing DATEDIF and getting #NAME?. DATEDIF is a hidden legacy function. It works, but Excel does not suggest it. Check spelling and that you have not added a space or used smart quotes around the unit letter.
- Dates stored as text. This is the most common cause of #VALUE! errors. The formula bar reveals the truth: if the date does not look like a date there, convert the column first.
- Forgetting that TODAY() is volatile. It updates every time the workbook recalculates, so a saved age can change overnight. That is correct behaviour, but it means printed reports go stale. Use a fixed DATE for snapshots.
- Birth dates in the future. DATEDIF returns #NUM! if the start date is later than the end date. Guard with IF(A2>TODAY(),"Not yet born", ...) if your data may contain future dates.
- Regional date formats. A date typed as 03/04/1990 means 4 March in the UK and 4 March in the US? Actually it means 3 April in the US and 4 March in the UK. Mixed formats produce silently wrong ages. Set the column format explicitly and check a few rows.
Tips
- Name your birth date column (Formulas > Define Name) so formulas read clearly, for example =DATEDIF(BirthDate, TODAY(), "Y").
- Use a table (Insert > Table) so formulas fill automatically as new rows are added.
- To show age as "34y 5m 12d", chain three DATEDIF calls with "Y", "YM" and "MD". The "YM" and "MD" units return the remainder after whole years and months.
- For age bands (0-17, 18-64, 65+), combine DATEDIF with IF or IFS rather than sorting manually.
- Keep a helper column with the calculation date if you need reproducible results for audits or mail merges.
Troubleshooting
- #VALUE! error: one of the arguments is text or blank. Check the birth date cell and the unit letter. The unit must be in double quotes: "Y", not Y.
- #NUM! error: the start date is after the end date, or the dates are invalid. Check for future birth dates or reversed arguments.
- #NAME? error: the function name is misspelled or the unit is not quoted. Retype the formula rather than pasting from a document that may contain curly quotes.
- Result looks like a date (e.g. 1900-02-03): the cell is formatted as a date. Change the format to General or Number.
- Age is off by one for some rows: check whether those birth dates are stored as text or in a different regional format. Also confirm you are using "Y" (complete years) rather than subtracting years directly.
- Formula does not update: calculation may be set to Manual. Go to Formulas > Calculation Options and choose Automatic.
Frequently Asked Questions
Why doesn't DATEDIF appear in Excel's function list?
DATEDIF is a legacy function kept for compatibility with older spreadsheets. It is not listed or suggested by autocomplete, but it works in all current Excel versions when typed correctly.
Can I calculate age in years and months together?
Yes. Combine DATEDIF with the "Y" and "YM" units: =DATEDIF(A2,TODAY(),"Y")&" years "&DATEDIF(A2,TODAY(),"YM")&" months". The "YM" unit gives the leftover months after whole years.
Does the formula account for leap years?
DATEDIF counts calendar years, so leap years are handled correctly. The (TODAY()-A2)/365.25 method approximates leap years but can still be off by a day around birthdays; use INT to round down.
How do I calculate age on a specific date rather than today?
Replace TODAY() with a DATE function or a cell reference, for example =DATEDIF(A2,DATE(2025,12,31),"Y"). The result is the age on that date and does not change when the workbook is reopened.
Why do I get a decimal instead of a whole number?
You are probably using subtraction and division rather than DATEDIF. Wrap the result in INT, or switch to DATEDIF with the "Y" unit for completed years.
Can I calculate age from a text date like "15 Jan 1990"?
Usually yes, if Excel recognises it as a date. If not, convert the column with Data > Text to Columns or use DATEVALUE. Check the formula bar to confirm the cell holds a real date before relying on the result.