Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Calculate Age in Excel: Step-by-Step Guide

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

The fastest way to get someone's age in Excel is =DATEDIF(birthdate, TODAY(), "Y"), which returns whole years between a birth date and today and updates automatically whenever the sheet recalculates. Replace birthdate with the cell holding the date, for example =DATEDIF(A2,TODAY(),"Y"). Excel stores dates as serial numbers, so once the dates are valid this formula is exact rather than approximate, and it handles leap years correctly. The catch is that DATEDIF only works properly if the start cell really contains a date, not text like "12 March 1990" typed as free text, so make sure your data is clean before you start.

What You'll Need

  • Excel on Windows, Mac, or Excel for the web (the formulas and functions below exist in all of them).
  • A column of birth dates entered as real dates, not text.
  • One empty column (or a few) beside your dates for the result.
  • Basic comfort with typing a formula into a cell and pressing Enter.

Step-by-Step

  1. Set up your data. Put the birth dates in their own column, say column A, with a header like Birthdate in A1 and the first date in A2. Leave the next column free for the age result.
  2. Check that the dates are real dates. Click a birth date cell and look at the formula bar. A real date appears the same way it is displayed, and the cell is usually right-aligned by default. If the cell is left-aligned or shows an apostrophe before the value when you click it, Excel is treating it as text and none of the age formulas will work. Fix this by using Data > Text to Columns, choosing Delimited, clicking Next through the delimiters, then choosing Date with the right date order (MDY or DMY) on the last screen, or by re-typing the value in a recognised format such as 1990-03-12.
  3. Enter the basic age formula. In the first result cell, type =DATEDIF(A2,TODAY(),"Y") and press Enter. This gives the number of full years completed as of today. Each new birth date entered below will need the same formula, so copy it down rather than typing it again.
  4. Fill the formula down. Select the cell with the formula, click the small square at the bottom-right corner of the selection, and drag down to the last birth date, or double-click that square to auto-fill alongside adjacent data. Every row now shows a whole-number age.
  5. Add precision if you want months. For a result like "34 years, 5 months", enter =DATEDIF(A2,TODAY(),"Y")&" years, "&DATEDIF(A2,TODAY(),"YM")&" months". The YM argument gives leftover months after the whole years are counted.
  6. Show days too, if needed. Extend it to =DATEDIF(A2,TODAY(),"Y")&" years, "&DATEDIF(A2,TODAY(),"YM")&" months, "&DATEDIF(A2,TODAY(),"MD")&" days". This concatenates the parts into readable text.
  7. Use a fixed reference date instead of today where relevant. If you need age at a particular date, such as the start of a sports season or an admission cut-off, put that date in a cell (say C1) and use =DATEDIF(A2,$C1,"Y"). The dollar signs lock the reference so it copies down correctly.
  8. Present the output as plain numbers. If you used the concatenation versions in steps 5 and 6, the result is text, not a number, and cannot be averaged or sorted numerically. Keep one column with the plain DATEDIF number if you need to sort, filter, or calculate with it.
  9. Optionally tidy the result. Select the age column and apply number formatting if desired; whole years are already integers, so no decimals are needed. Widen the column so long text strings in the concatenated versions are fully visible.

Common Mistakes

  • Birth dates stored as text. This is the most frequent cause of #VALUE! errors. The formula bar check in step 2 catches it before you write any formulas.
  • Reversed day and month. Entering 03/12/1990 intending 12 March but Excel reading it as 3 December shifts the age slightly. Fix the regional date format or enter dates as 1990-03-12 to avoid ambiguity entirely.
  • Using TODAY() as the start argument. Putting TODAY() first and the birth date second returns #NUM! because the start date must be earlier than the end date.
  • Expecting DATEDIF to autocomplete. DATEDIF does not appear in Excel's function suggestions as you type. It still works; you just have to type the name in full.
  • Forgetting the quotation marks around "Y". Without them Excel returns an error or unexpected results.
  • Assuming ages update everywhere. TODAY() recalculates when the workbook recalculates, which happens automatically on open. A printed sheet or exported PDF, by contrast, freezes whatever value was there at print time.

Tips

  • If DATEDIF feels awkward, an alternative is =YEAR(TODAY())-YEAR(A2)-IF(OR(MONTH(TODAY())<MONTH(A2),AND(MONTH(TODAY())=MONTH(A2),DAY(TODAY())<DAY(A2))),1,0), which gives the same whole-year result.
  • To find age in months for infants, use =DATEDIF(A2,TODAY(),"M").
  • To get an age on a fixed date in the past, put the fixed date in a cell and reference it, as in step 7. This keeps the calculation transparent and easy to change.
  • If you need to flag upcoming birthdays, compare MONTH and DAY of the birth date with today's values rather than the year.
  • Keep a backup copy before running Text to Columns on a column of imported dates, since a wrong date order can silently change values.
  • If your spreadsheet has mixed date formats from different sources, clean each column separately and re-check the formula bar output afterwards.

Troubleshooting

  • #VALUE! error. One of the arguments is not a date. Click the birth date cell and confirm it is a real date, then correct it as described in step 2.
  • #NUM! error. The start date is later than the end date, or the unit is invalid. Swap the arguments so the birth date comes first.
  • Result is 0. The birth date is likely in the future, or the date was interpreted as text. Check the cell value in the formula bar.
  • Ages off by exactly one. Usually a day-month mix-up in the source date. Compare the displayed date against the original record.
  • Formula shows as text. If the cell displays the formula text rather than a result, the cell is formatted as Text. Set the cell format to General, then re-enter the formula by pressing F2 and Enter.
  • Nothing recalculates. Check that calculation is set to automatic; in some workbooks it is switched to manual. Look in the Formulas tab's calculation options.
  • If that did not work: rebuild a fresh test sheet with three or four dates typed manually, apply the formula there, and compare. This isolates whether the problem is the formula or the data.

Frequently Asked Questions

Why doesn't DATEDIF appear when I start typing it?

DATEDIF is a legacy function kept for compatibility and is not offered in the autocomplete list. It still calculates correctly if typed in full, with commas between arguments and the unit in quotes.

Can I calculate age on a specific date rather than today?

Yes. Put the reference date in its own cell and use =DATEDIF(A2,$C$1,"Y"), where C1 holds the date. This is common for eligibility checks such as age at the start of a season.

Is there a function that gives age directly?

No single built-in function returns age. DATEDIF with the Y unit is the standard method; YEAR and MONTH/DAY arithmetic is the usual alternative.

Does the result update tomorrow automatically?

Yes, because TODAY() is volatile and recalculates each time the workbook opens or recalculates. That is why a saved workbook can show a different age than when you last viewed it.

Can DATEDIF also count months or days?

Yes. Use "M" for complete months, "D" for days, and "YM", "MD" and "YD" for the leftover parts after whole years or months are counted.

Does this work in Excel for the web and on Mac?

Yes. DATEDIF, TODAY and the YEAR, MONTH and DAY functions all exist in Excel for the web and Excel for Mac, with only minor differences in where the menu options sit.