Age Calculator: How to Calculate Age Using MS Excel


Age Calculator (Excel DATEDIF Method)

A precise tool to calculate age in years, months, and days, mirroring the logic used to calculate age using MS Excel.

Online Age Calculator



Enter the starting date, such as a date of birth.

Please enter a valid date of birth.



Defaults to today’s date. Change it to calculate age on a specific date.

Please enter a valid end date.


Visual breakdown of age components.

What does it mean to calculate age using MS Excel?

To calculate age using MS Excel is to determine the time elapsed between a start date (typically a date of birth) and an end date. While simple subtraction of years might seem sufficient, a true age calculation accounts for the specific months and days, providing a precise result. Excel does not have a dedicated “AGE” function, but it offers a powerful, albeit somewhat hidden, function called DATEDIF that is perfect for this task. This function allows users to find the difference between two dates in completed years, months, or days, which is essential for accurate age-related data analysis in HR, demographics, or project management.

The DATEDIF Formula to Calculate Age in Excel

The most accurate and flexible way to calculate age using MS Excel is with the DATEDIF function. The function takes three arguments: a start date, an end date, and a unit.

The syntax is: =DATEDIF(start_date, end_date, "unit")

To get a person’s complete age in years, months, and days, you typically use three separate DATEDIF formulas and concatenate them. For example, if the date of birth is in cell A2, you would use:

  • For full years: =DATEDIF(A2, TODAY(), "Y")
  • For months after full years: =DATEDIF(A2, TODAY(), "YM")
  • For days after full months: =DATEDIF(A2, TODAY(), "MD")
DATEDIF Unit Explanations
Unit Meaning Typical Use Case
"Y" Returns the number of complete years. Calculating a person’s primary age.
"M" Returns the number of complete months. Finding the total age in months.
"D" Returns the number of total days. Calculating the total duration in days.
"YM" Returns the number of months, ignoring years. The “months” part of an “X years, Y months” age.
"YD" Returns the number of days, ignoring years. Calculating “day of the year” difference.
"MD" Returns the number of days, ignoring months and years. The “days” part of a full age calculation.

Learn more about how to use the DATEDIF function for various calculations.

Practical Examples

Example 1: Basic Age Calculation

Let’s say you want to calculate the age of someone born on July 15, 1990 as of today’s date.

  • Inputs: Start Date = 1990-07-15, End Date = Today
  • Excel Formulas:
    • Years: =DATEDIF("1990-07-15", TODAY(), "Y")
    • Months: =DATEDIF("1990-07-15", TODAY(), "YM")
    • Days: =DATEDIF("1990-07-15", TODAY(), "MD")
  • Results: The calculator would combine these to show a complete age in years, months, and days.

Example 2: Age at a Specific Event

Imagine you need to know an employee’s age when they joined the company on March 1, 2018. Their date of birth is May 20, 1985.

  • Inputs: Start Date = 1985-05-20, End Date = 2018-03-01
  • Excel Formula: =DATEDIF("1985-05-20", "2018-03-01", "Y") & " years, " & DATEDIF("1985-05-20", "2018-03-01", "YM") & " months, " & DATEDIF("1985-05-20", "2018-03-01", "MD") & " days"
  • Result: 32 years, 9 months, 9 days. This kind of calculation is vital for HR and benefits administration.

For more date calculations, you might be interested in a Date Difference Calculator.

How to Use This Age Calculator

  1. Enter Date of Birth: Use the “Date of Birth” input field to select the starting date. The calendar picker makes this easy.
  2. Select Calculation Date: The second field automatically defaults to the current date. You can change this to any date in the past or future to calculate age at a specific point in time.
  3. View the Results: The calculator instantly updates, showing the primary result (age in years, months, and days) and intermediate values like total months and total days.
  4. Interpret the Chart: The bar chart provides a simple visual representation of the age components, making the data easy to digest at a glance.

Key Factors That Affect Age Calculation

  • Leap Years: Accurate age calculations must account for the extra day in leap years. A simple division by 365 will lead to errors. The DATEDIF function handles this correctly.
  • Month Lengths: Months have different numbers of days (28, 29, 30, or 31). A precise calculation, like the one this tool performs, navigates these differences.
  • End Date Inclusivity: Does the calculation include the end date? Standard age calculation measures completed periods, so the end date is the boundary, not part of the duration.
  • Time of Day: For most purposes, the time of birth is ignored. Calculations are typically based on the start of the birth date to the start of the end date.
  • The “MD” Unit Bug: Microsoft warns that the "MD" unit in DATEDIF can sometimes produce incorrect results, particularly with end-of-month dates. Our JavaScript calculator uses a robust method to avoid this issue.
  • Date System Start: Excel’s default date system starts on January 1, 1900. Calculating dates before this can be problematic in some versions of Excel.

A good Retirement Planning Calculator also relies on accurate age calculations.

Frequently Asked Questions (FAQ)

1. How do you calculate age in Excel without DATEDIF?

You can use the YEARFRAC function or a simple mathematical formula. For example, =INT((TODAY()-A2)/365.25) provides a close approximation of years, but DATEDIF is more precise for full years, months, and days.

2. Why is my Excel age calculation sometimes off by one day?

This often happens if you simply subtract dates and divide. The issue usually relates to how leap years are handled or whether the end date is being counted correctly. Using =DATEDIF(start, end, "Y") for years ensures only completed years are counted, improving accuracy.

3. What’s the most accurate formula to calculate age using MS Excel?

The combination of three DATEDIF functions (using “Y”, “YM”, and “MD” units) provides the most detailed and human-readable age. For example: =DATEDIF(A2, TODAY(), "Y") & " years, " & DATEDIF(A2, TODAY(), "YM") & " months, " & DATEDIF(A2, TODAY(), "MD") & " days".

4. Can this calculator find the difference between any two dates?

Yes. Although it’s designed as an age calculator, it functions as a general date difference tool. Simply enter any start and end date to find the duration between them.

5. How does Excel store dates?

Excel stores dates as sequential serial numbers. For example, January 1, 1900, is serial number 1. This allows dates to be used in calculations just like any other number.

6. Why does the DATEDIF function not auto-complete in Excel?

DATEDIF is included in Excel for compatibility with older spreadsheet programs like Lotus 1-2-3. Microsoft does not officially document it in newer versions, so it doesn’t appear in the formula auto-complete list.

7. How can I calculate the total number of months between two dates?

Use the DATEDIF function with the “M” unit. The formula =DATEDIF(start_date, end_date, "M") will return the number of full months between the two dates.

8. Is there a way to highlight people under a certain age in an Excel sheet?

Yes, you can use Conditional Formatting with a formula. For example, to highlight anyone under 18 based on a birth date in cell A2, you could use the rule formula =DATEDIF(A2, TODAY(), "Y") < 18 and set a format (e.g., a fill color).

© 2026 Your Company. This calculator is for informational purposes only. Consult a professional for important calculations.


Leave a Reply

Your email address will not be published. Required fields are marked *