Calculating a person's age from a birth date is a common requirement in spreadsheets, and Microsoft Excel provides several reliable methods to convert date to age accurately. Whether you are managing employee records, tracking patient histories, or analyzing customer demographics, determining age dynamically ensures your data remains current without manual updates. The primary approach involves comparing a given birth date against today’s date using functions that account for complete years elapsed.
Using the DATEDIF Function for Precise Age Calculation
The most traditional and flexible function for this task is DATEDIF, which stands for Date Difference. This function calculates the interval between two dates in years, months, or days, making it ideal for age derivation. To convert date to age in years only, you specify the birth date, the current date, and the unit "Y" for years.
Enter the birth date in a cell, for example, B2.
Use the formula =DATEDIF(B2, TODAY(), "Y") in another cell to return the integer age.
The TODAY function updates automatically, ensuring the age reflects the current date.
This method handles leap years and varying month lengths internally, reducing the risk of off-by-one errors that manual calculations might introduce.
Displaying Age in Years, Months, and Days
Comprehensive Age Breakdown
For scenarios requiring more detail, such as medical forms or legal documents, showing age in years, months, and days adds clarity. You can extend the DATEDIF function by combining multiple instances to capture each interval sequentially. The first calculation extracts years, the second determines remaining months after years are accounted for, and the third finds the leftover days.
Years: =DATEDIF(B2, TODAY(), "Y")
Months: =DATEDIF(B2, TODAY(), "YM")
Days: =DATEDIF(B2, TODAY(), "MD")
By concatenating these results with text labels, you create a human-readable string like "32 years, 4 months, 15 days". This approach maintains accuracy because DATEDIF inherently adjusts for calendar irregularities, such as February 29 in leap years.
Alternative Method with YEARFRAC and INT Functions
An alternative to DATEDIF involves the YEARFRAC function, which returns a decimal representing the fraction of a year between two dates. Wrapping YEARFRAC with the INT function truncates the decimal to produce a whole number age. Some users prefer this method for its straightforward syntax, though it may not handle partial months as explicitly as DATEDIF.
Formula example: =INT(YEARFRAC(B2, TODAY())) .
YEARFRAC uses a basis parameter that defines the day count convention; omitting it defaults to US 30/360, but setting it to 1 uses actual days/actual months.
For most age calculations, the default or a 1 basis provides sufficiently accurate results.
While YEARFRAC is concise, DATEDIF remains more explicit when you need to verify the exact month and day components later.
Handling Common Errors and Data Issues
When converting date to age, encountering errors is often due to invalid date formats or future birth dates. If the birth date cell contains text that Excel does not recognize, the formula will return a #VALUE! error, so validating data entry is crucial. Additionally, if the birth date is in the future, the result will be negative, which may require conditional logic to flag such inconsistencies.
Use =ISNUMBER(B2) to verify the cell contains a valid serial date number.