To calculate age in Excel, the most efficient method is using the =DATEDIF(start_date, end_date, "unit") formula. For example, if a birth date is in cell A2, use =DATEDIF(A2, TODAY(), "y") to get the age in completed years. This function calculates the difference between two dates based on a specific interval, making it the gold standard for HR sheets, school registries, and personal databases.

What You'll Need

  • A computer with Microsoft Excel installed (works on Office 365, Excel 2021, 2019, 2016, and older versions).
  • A dataset containing dates of birth formatted as valid Excel dates.
  • Basic knowledge of how to select cells and enter formulas.

Step-by-Step

  1. Prepare Your Data: Open your Excel workbook. Ensure your dates of birth are in one column (e.g., Column A) and that they are formatted as "Date" and not as "Text." If the dates are aligned to the right of the cell, Excel recognizes them as dates. If they are aligned to the left, you may need to convert them using the "Text to Columns" tool or by changing the cell format.
  2. Select the Target Cell: Click on the cell where you want the age to appear (e.g., Cell B2, next to the first birth date).
  3. Enter the DATEDIF Formula: Type the following formula exactly: =DATEDIF(A2, TODAY(), "y").
    • A2 refers to the cell containing the birth date.
    • TODAY() is a volatile function that automatically pulls the current date from your system clock, ensuring the age updates every time you open the file.
    • "y" tells Excel to return the difference in complete years.
  4. Press Enter: Once you hit Enter, Excel will display the number of full years that have passed since the date in A2.
  5. Apply to All Rows: Hover your mouse over the bottom-right corner of cell B2 until a small black cross (the fill handle) appears. Click and drag this handle down to the bottom of your list to calculate the age for every person in your dataset.
  6. (Optional) Calculate Detailed Age: If you need the age in years, months, and days (e.g., "25 Years, 3 Months, 2 Days"), you will need to combine three DATEDIF formulas using the concatenation operator (&). Use this formula:
    =DATEDIF(A2, TODAY(), "y") & " Years, " & DATEDIF(A2, TODAY(), "ym") & " Months, " & DATEDIF(A2, TODAY(), "md") & " Days"
    • "ym" ignores the years and calculates the remaining months.
    • "md" ignores the months and years to calculate the remaining days.

Common Mistakes

One of the most frequent errors is using the wrong date format. If your birth date is entered as 12.05.1990 but your system is set to US format (MM/DD/YYYY), Excel will treat the entry as text. Because DATEDIF requires numerical date values, it will return a #VALUE! error. Always verify that your dates are recognized by Excel by changing the cell format to "Number"; if the date turns into a five-digit number (like 32970), it is a valid Excel date.

Another common mistake is confusing the order of arguments in the DATEDIF function. The formula must always follow the order: (start_date, end_date, unit). If you put the current date first and the birth date second, Excel will return a #NUM! error because it cannot calculate a negative time interval for this specific function.

Users also often forget the quotation marks around the unit. Writing =DATEDIF(A2, TODAY(), y) without quotes around the y will result in a #NAME? error, as Excel will look for a named range called "y" instead of treating it as a text command for "years."

Tips

To make your spreadsheet more professional, use Conditional Formatting to highlight specific age groups. For example, you can set a rule so that any cell in the age column containing a value over 65 turns red, or any value under 18 turns green. This is incredibly useful for auditing lists for legal compliance or demographic analysis.

If you are calculating age for a specific point in history (e.g., "How old was this person on December 31, 2020?"), replace the TODAY() function with a cell reference containing that specific date. For instance, if your cutoff date is in cell C1, use =DATEDIF(A2, $C$1, "y"). The dollar signs (absolute reference) ensure that when you drag the formula down, it always looks at cell C1 for the end date.

For those who prefer not to use the "hidden" DATEDIF function, you can use =YEARFRAC(A2, TODAY()). This returns a decimal (e.g., 25.42). To get the whole number of years, wrap it in the INT function: =INT(YEARFRAC(A2, TODAY())). This is often faster to type and easier to remember for some users.

Troubleshooting

If your formula returns #VALUE!, the most likely cause is that the birth date is not a real date. To fix this, select the column of dates, go to the Data tab, select Text to Columns, click Next twice, and in the Column data format section, select Date and choose the format the dates were originally written in (e.g., DMY). Click Finish.

If you see a #NUM! error, check that the birth date is not in the future. DATEDIF cannot handle cases where the start date is later than the end date. If you are calculating ages for a list that might include future dates (like expected delivery dates), you can wrap your formula in an IFERROR function: =IFERROR(DATEDIF(A2, TODAY(), "y"), "Invalid Date").

If the result looks like a weird date (e.g., 01/01/1900) instead of a number like 30, it is because Excel has automatically formatted the result cell as a "Date." To fix this, go to the Home tab, find the Number Format dropdown menu, and change it from "Date" to "General" or "Number." This will reveal the actual integer representing the age.

Frequently Asked Questions

Why is DATEDIF not listed in the Excel function menu?

DATEDIF is a "compatibility function" kept in Excel for users transitioning from Lotus 1-2-3. Because of this, Microsoft does not list it in the formula autocomplete menu, but it works perfectly in all versions of Excel if typed manually.

Can I calculate age in months only?

Yes. Use the formula =DATEDIF(A2, TODAY(), "m"). This will give you the total number of months that have elapsed since the birth date, regardless of how many years have passed.

How do I calculate age if I only have the birth year?

If you only have the year (e.g., 1990) in cell A2, you don't need DATEDIF. Simply subtract the birth year from the current year: =YEAR(TODAY()) - A2. Note that this is less accurate as it doesn't account for whether the person has had their birthday yet this year.

Will the age update automatically every year?

Yes, as long as you use the TODAY() function. Every time the workbook is opened or recalculated, Excel checks the current system date and adjusts the age accordingly.

What is the difference between "y" and "ym"?

The "y" unit returns the total number of full years between two dates. The "ym" unit returns the number of months remaining after the full years have been subtracted. For example, if someone is 25 years and 4 months old, "y" returns 25 and "ym" returns 4.

Does this work in Google Sheets?

Yes, the DATEDIF function works exactly the same way in Google Sheets as it does in Microsoft Excel, using the same syntax and units.