Calculating age in Excel is a useful skill, especially when working with data that involves dates. In this blog post, we'll explore different methods to determine age using Excel formulas. Whether you're tracking employee ages, analyzing customer demographics, or managing any other age-related data, these formulas will be your go-to tools.
Method 1: Using the YEARFRAC Function

The YEARFRAC function in Excel calculates the fraction of a year represented by the number of whole days between two dates. It's a versatile function that can be used to determine age or any other time-based calculations.
The syntax for the YEARFRAC function is as follows:
=YEARFRAC(start_date, end_date, [basis])
- start_date: The date of birth or the start date.
- end_date: The current date or the end date.
- basis: (Optional) A number that specifies the day count basis to use. Common values are 0 (US 30/360), 1 (Actual/Actual), and 3 (European 30/360). The default is 1.
Here's how you can use the YEARFRAC function to calculate age:
- In a new cell, enter the formula:
=YEARFRAC(A2, TODAY(), 1)
. ReplaceA2
with the cell containing the date of birth. - Press Enter to get the age in years.
- To format the result as a number, right-click the cell, select Format Cells, and choose Number or General from the Category list.
The formula calculates the fraction of a year between the date of birth and the current date. For example, if the date of birth is 01/01/2000 and the current date is 01/01/2023, the formula will return 23, indicating that the person is 23 years old.
Method 2: Using the DATEDIF Function

The DATEDIF function calculates the difference between two dates in a specified time interval. It's a useful function for calculating age, especially when you want to know the number of years, months, or days.
The syntax for the DATEDIF function is:
=DATEDIF(start_date, end_date, interval)
- start_date: The date of birth or the start date.
- end_date: The current date or the end date.
- interval: The time interval for the calculation. Common values include
"y"
for years,"m"
for months, and"d"
for days.
Here's how you can use the DATEDIF function to calculate age:
- In a new cell, enter the formula:
=DATEDIF(A2, TODAY(), "y")&" years, "&DATEDIF(A2, TODAY(), "ym")&" months, "&DATEDIF(A2, TODAY(), "md")&" days"
. ReplaceA2
with the cell containing the date of birth. - Press Enter to get the age in years, months, and days.
- To format the result as a number, right-click the cell, select Format Cells, and choose Number or General from the Category list.
The formula calculates the difference between the date of birth and the current date in years, months, and days. It then concatenates these values to display the age in a human-readable format.
Method 3: Using Simple Date Calculations

If you prefer a more straightforward approach, you can use simple date calculations to determine age.
- Subtract the date of birth from the current date using the formula:
=TODAY() - A2
. ReplaceA2
with the cell containing the date of birth. - The result will be the number of days between the two dates.
- To calculate the age in years, divide the result by 365.25 (the average number of days in a year):
=INT((TODAY() - A2) / 365.25)
. - To calculate the age in months, divide the result by 30.4375 (the average number of days in a month):
=INT((TODAY() - A2) / 30.4375)
. - To calculate the age in days, simply use the result of the subtraction.
This method provides a basic calculation for age, but it may not be as accurate as the previous methods, especially for dates with leap years.
Notes

⚠️ Note: When using the YEARFRAC and DATEDIF functions, ensure that the dates are entered correctly and in the appropriate format. Excel uses the mm/dd/yyyy format by default, but you can change it in the Excel Options.
💡 Tip: To make your formulas more dynamic, you can use named ranges instead of cell references. This way, you can easily change the input data without modifying the formulas.
Conclusion

Determining age in Excel is a valuable skill for data analysis and management. The YEARFRAC and DATEDIF functions provide accurate and flexible ways to calculate age, while simple date calculations offer a basic alternative. Choose the method that best suits your needs and preferences. With these formulas, you'll be able to handle age-related data with ease and precision.
FAQ

How can I calculate age in months and days using Excel formulas?

+
To calculate age in months and days, you can use the DATEDIF function. The formula is: =DATEDIF(A2, TODAY(), “md”)
. Replace A2
with the cell containing the date of birth. This formula will give you the age in months and days.
What if I want to calculate age in years and months without days?

+
If you only need the age in years and months without days, you can use the DATEDIF function with the “ym” interval. The formula is: =DATEDIF(A2, TODAY(), “ym”)
. Replace A2
with the cell containing the date of birth. This formula will give you the age in years and months.
Can I format the age calculation to display only the years and months?

+
Yes, you can format the age calculation to display only the years and months. After calculating the age using the DATEDIF function, you can apply a custom number format. Right-click the cell, select Format Cells, and choose Custom from the Category list. In the Type field, enter [m] years;[m] months
. This will display the age in years and months only.