Excel Formula to Find Age from Date of Birth
Introduction
Calculating a person’s age from a date of birth is a common task in Excel for HR, finance, and personal tracking. The excel formula to find age from date of birth can be quickly implemented using built‑in functions like DATEDIF, YEARFRAC, or a custom combination of TODAY and date arithmetic. This article walks you through each method, explains the underlying logic, and answers frequently asked questions so you can choose the most appropriate approach for your spreadsheet needs The details matter here..
Steps to Calculate Age Using Excel Formulas
Using the DATEDIF Function
The DATEDIF function is Excel’s dedicated tool for calculating the difference between two dates in various units (years, months, days). It’s simple, reliable, and widely used in professional environments.
- Prepare your data – In column A, list the dates of birth (e.g., A2 contains “15/07/1990”).
- Enter the formula – In cell B2, type:
=DATEDIF(A2,TODAY(),"Y")- The first argument is the start date (date of birth).
- The second argument is the end date (today’s date).
- The third argument “Y” returns the number of complete years.
- Copy down – Drag the fill handle down to apply the formula to the entire column.
Result: Cell B2 will display “34” (if today is 2024).
Tip: To also get months and days, add two more arguments:
"YM"for months after the years, and"MD"for days after the months. Example:=DATEDIF(A2,TODAY(),"Y") & " years, " & DATEDIF(A2,TODAY(),"YM") & " months".
Using the YEARFRAC Function
YEARFRAC calculates the fraction of a year between two dates, which can be rounded to obtain age. It’s especially useful when you need decimal ages (e.g., for actuarial calculations).
- Input the dates – Place the date of birth in column A (A2) and let Excel’s TODAY function provide the current date.
- Apply the formula – In B2, type:
=ROUND(YEARFRAC(A2,TODAY()),0)YEARFRAC(start_date, end_date)returns a decimal like 34.27.ROUND(...,0)rounds to the nearest whole number.
- Propagate – Fill down as needed.
Result: You’ll see “34”.
Note: The default basis for YEARFRAC is 30‑day months/360‑day years (basis 0). If you need actual calendar days, add
,1as the third argument:=ROUND(YEARFRAC(A2,TODAY(),1),0).
Using a Custom Formula with TODAY()
For users who prefer a formula that doesn’t rely on DATEDIF (which is somewhat “hidden” in Excel), a custom calculation using YEAR, MONTH, and DAY functions can be built.
- Extract components – In separate helper columns, break down the dates:
- Years:
=YEAR(TODAY()) - YEAR(A2) - Months:
=MONTH(TODAY()) - MONTH(A2) - Days:
=DAY(TODAY()) - DAY(A2)
- Years:
- Adjust for negative values – If the day or month result is negative, borrow from the higher unit. A compact version combines these steps:
=INT((TODAY()-A2)/365.25)- Subtracting the birth date from today gives the total days difference.
- Dividing by 365.25 approximates the number of years (accounting for leap years).
INTtruncates the decimal, leaving whole years.
Result: “34”.
Caution: This method is less precise for edge cases (e.g., leap day birthdays) but works well for most general purposes.
Scientific Explanation
How DATEDIF Works
DATEDIF internally counts the number of complete calendar periods between two dates. When you specify “Y”, it calculates how many full year boundaries have been crossed. Here's one way to look at it: from 15 July 1990 to 15 July 2024, DATEDIF returns 34 because exactly 34 year‑boundaries have been passed. The “YM” and “MD” arguments continue the counting for months and days after the years have been accounted for.
YEARFRAC’s Fractional Logic
YEARFRAC uses a day‑count convention to convert a date interval into a fraction of a year. The default convention (basis 0) assumes each month is 30 days and each year is 360 days, simplifying financial calculations. By specifying basis 1 (actual/actual), Excel uses the real number of days in each month and year, providing a more accurate fractional age. The rounding step then converts that fraction into an integer age.
Date Arithmetic in Custom Formulas
Subtracting two dates in Excel yields the difference in days as a serial number (e.g., 12 345). Dividing by 365.25 approximates the number of years because the average length of a year, accounting for leap years, is 365.25 days. The INT function discards the fractional part, leaving the integer number of completed years. This approach is straightforward but can be off by a day around leap days because it does not consider month‑day alignment.
FAQ
Q: Can DATEDIF calculate age in months and days as well?
A: Yes. Use additional arguments: =DATEDIF(A2,TODAY(),"YM") for months after years, and =DATEDIF(A2,TODAY(),"MD") for days after months. Combine them in a single formula for a readable result.
Q: What if the date of birth is in a non‑standard format?
A: Ensure the cells are formatted as Date (e.g., “dd/mm/yyyy” or “mm/dd/yyyy”). Excel will then recognize them correctly. You can change the format via Format Cells → Date Nothing fancy..
Q: Does YEARFRAC work with future dates?
A: Yes. If the date in column A is a future date (e.g., a birth yet to occur), YEARFRAC will return a negative fraction. Wrap it with ABS or adjust the order of arguments to keep the result positive.
Q: Are there any pitfalls with the custom INT formula?
A: The custom formula can be off by one day for people born on 29 February in non‑leap years. For precise age calculation, prefer DATEDIF or YEARFRAC with basis 1 Easy to understand, harder to ignore..
Q: How can I make the age update automatically for each employee’s start date?
A: Use a dynamic named range or Excel Table. When you