Excel Age Calculation Calculator: From DOB to Years, Months, Days


Excel Age Calculation Tool

Instantly find age from a date of birth and get the exact Excel formula.



Enter the starting date of birth.


Defaults to today. Change to calculate age at a specific point in time.

The ‘As Of’ date must be after the Date of Birth.

A Deep Dive into Calculating Age in Excel Using DOB

Calculating a person’s age from their date of birth (DOB) is a fundamental task in data management, especially in fields like human resources, demographics, and customer relationship management. Microsoft Excel, while not having a single “AGE” function, provides a powerful, albeit slightly hidden, function called DATEDIF that is perfect for this job. This article explores everything you need to know about calculating age in excel using dob, from the basic formula to advanced applications.

What is Calculating Age in Excel Using DOB?

This refers to the process of determining the time elapsed from a specific date of birth to a second date (usually the current day). The goal is often not just to find the age in years, but to get a precise breakdown of years, months, and days. While you can perform a rough calculation by subtracting dates and dividing by 365.25, this method is prone to errors due to leap years and varying month lengths. The most reliable method involves using the DATEDIF function, which is specifically designed for this type of date-difference calculation.

The DATEDIF Formula and Explanation

The core of accurately calculating age in Excel is the DATEDIF function. It’s considered a “compatibility” function, originally from Lotus 1-2-3, which is why Excel doesn’t autocomplete it. However, it is fully functional.

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

To achieve a full age breakdown, you combine three DATEDIF calls. For instance, if the DOB is in cell A1 and the “as of” date (e.g., using TODAY()) is in B1, the complete formula is:

=DATEDIF(A1, B1, "y") & " Years, " & DATEDIF(A1, B1, "ym") & " Months, " & DATEDIF(A1, B1, "md") & " Days"

Variables Table

This table explains each ‘unit’ parameter used in the DATEDIF function for age calculation.
Variable (Unit) Meaning Unit Typical Range
“y” Returns the number of complete years between the two dates. Years 0+
“m” Returns the number of complete months between the dates. Months 0+
“d” Returns the total number of days between the dates. Days 0+
“ym” Returns the number of months remaining after subtracting the complete years. Months 0-11
“md” Returns the number of days remaining after subtracting complete years and months. (Note: “md” can have issues, especially with end-of-month dates). Days 0-30
“yd” Returns the number of days between the dates, ignoring the years. Days 0-365

Practical Examples

Example 1: Standard Age Calculation

Let’s calculate the age of someone born on June 15, 1990, as of January 25, 2026.

  • Inputs:
    • Start Date (DOB): 1990-06-15
    • End Date: 2026-01-25
  • Formula Parts:
    • =DATEDIF("1990-06-15", "2026-01-25", "y") → 35
    • =DATEDIF("1990-06-15", "2026-01-25", "ym") → 7
    • =DATEDIF("1990-06-15", "2026-01-25", "md") → 10
  • Result: 35 Years, 7 Months, 10 Days

Example 2: Calculating Employee Tenure

You can use the same logic for calculating tenure in excel. Let’s find the service length of an employee who started on October 1, 2021, and their last day was December 20, 2025.

  • Inputs:
    • Start Date (Hire Date): 2021-10-01
    • End Date (Last Day): 2025-12-20
  • Result: Using the formula, the tenure is 4 Years, 2 Months, 19 Days.

How to Use This Age Calculation Calculator

Our tool simplifies the process of calculating age in excel using dob down to a few clicks.

  1. Enter Date of Birth: Use the date picker to select the person’s birth date.
  2. Set the ‘As Of’ Date: The calculator defaults to today’s date. You can change this to any past or future date to calculate age at a specific moment.
  3. Review the Results: The tool instantly displays the age in “Years, Months, Days” format, along with the total age in years, months, and days as separate values.
  4. Copy the Excel Formula: A key feature is the generated Excel formula. Click the ‘Copy Formula’ button and paste it directly into your spreadsheet. Remember to replace “A1” and “B1” with your actual cell references. For more help, check our guide on the Excel DATEDIF function.

Key Factors That Affect Age Calculation

  • Start and End Dates: The start_date must always be earlier than the end_date in DATEDIF, otherwise Excel will return a #NUM! error.
  • Leap Years: The DATEDIF function correctly accounts for leap years when calculating total days or years, making it more accurate than manual division.
  • The “md” Unit Anomaly: The “md” parameter is known to be buggy, sometimes returning negative numbers or incorrect values, particularly when the start date is at the end of a month (e.g., Jan 31). Our calculator uses a more robust JavaScript logic to avoid this issue.
  • Time of Day: Excel’s date functions, including DATEDIF, operate on whole days. They do not consider the time of day in their calculations.
  • Date Formatting: Ensure your dates in Excel are stored as actual date values, not as text. If a date is left-aligned in a cell, it might be text. Use the ‘Format Cells’ option to fix this.
  • Excel Version: While DATEDIF works in all modern versions (Excel 2007 through Microsoft 365), its undocumented nature means it lacks official support. See our advanced DATEDIF tricks for alternatives.

Frequently Asked Questions (FAQ)

1. How do I just calculate age in completed years?
Use the formula =DATEDIF(dob_cell, today_cell, "y"). This will return a single integer representing the number of full years passed.
2. Why am I getting a #NUM! error?
This typically happens when your start date (DOB) is later than your end date. Ensure the dates are in the correct order.
3. Can I calculate age as of a specific date in the past or future?
Yes. Instead of using TODAY() as the end date, enter a specific date in another cell or type it directly into the formula, like =DATEDIF(A1, "2030-01-01", "y").
4. Is there an alternative to DATEDIF for calculating age?
Yes, the YEARFRAC function is another option. The formula =INT(YEARFRAC(dob_cell, today_cell, 1)) gives the integer part of the age. It’s often considered more reliable by some experts. For more advanced excel tips, see our guide.
5. How does DATEDIF handle a leap day birthday (Feb 29)?
DATEDIF handles leap day birthdays correctly. It will consider the anniversary to be Feb 28 in non-leap years.
6. Why doesn’t DATEDIF appear in Excel’s function list?
It is a compatibility function included for legacy support with Lotus 1-2-3 spreadsheets. Because it’s not officially documented, Microsoft does not list it in the formula autocomplete or help files.
7. How can I calculate the total number of months or days of age?
Use the “m” or “d” units, respectively. =DATEDIF(A1, B1, "m") will give you the total number of full months lived.
8. What’s the best way to handle a list of dates of birth?
Enter the formula in the cell next to the first DOB. Then, click the small square (fill handle) at the bottom-right of the cell and drag it down to apply the formula to the entire list. Learn more about this with our Excel Formula Builder.

Related Tools and Internal Resources

Explore other calculators and guides to enhance your spreadsheet skills:

© 2026 Your Website. All rights reserved. This calculator is for informational purposes only.



Leave a Reply

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