How to Calculate Age in Excel Quickly and Easily
To calculate age in Excel, use the
DATEDIF function like =DATEDIF(birthdate, TODAY(), "Y") which returns the full years between the birthdate and today. Alternatively, YEARFRAC can calculate age as a decimal number.Syntax
The main formula to calculate age is =DATEDIF(start_date, end_date, unit).
- start_date: The birthdate or starting date.
- end_date: The date to calculate age up to, usually
TODAY()for current age. - unit: Defines the type of difference. Use
"Y"for full years.
Example: =DATEDIF(A1, TODAY(), "Y") calculates full years from date in A1 to today.
excel
=DATEDIF(start_date, end_date, "Y")Example
This example shows how to calculate age from a birthdate in cell A2 using the current date.
excel
A2: 1990-05-15 In B2 enter: =DATEDIF(A2, TODAY(), "Y")
Output
If today is 2024-06-01, B2 will show: 34
Common Pitfalls
Common mistakes include:
- Using
DATEDIFwith incorrect units like"y"(case sensitive, must be uppercase"Y"). - Not using
TODAY()for dynamic current date, which causes static results. - Entering birthdates as text instead of date format, which breaks calculations.
Always check date formats and use uppercase units.
excel
Wrong: =DATEDIF(A2, TODAY(), "y") Right: =DATEDIF(A2, TODAY(), "Y")
Quick Reference
| Function | Purpose | Example Usage | Output |
|---|---|---|---|
| DATEDIF | Calculate full years between two dates | =DATEDIF(A2, TODAY(), "Y") | Age in years (integer) |
| YEARFRAC | Calculate age as decimal years | =YEARFRAC(A2, TODAY()) | Age in years (decimal) |
Key Takeaways
Use =DATEDIF(birthdate, TODAY(), "Y") to get age in full years.
Ensure birthdates are in proper date format for accurate results.
Use uppercase "Y" in DATEDIF units to avoid errors.
TODAY() function keeps age calculation current automatically.
YEARFRAC can calculate age with decimal precision if needed.