Quick Answer & Formula
Excel
Sheets
Beginner
=DATEDIF(start_date, end_date, unit) DATEDIF calculates elapsed time between two dates. For years: =DATEDIF(Start, End, "Y"). For remaining months: =DATEDIF(Start, End, "YM"). For remaining days: =DATEDIF(Start, End, "MD").
DATEDIF Function in Excel & Google Sheets
The DATEDIF function calculates completed time periods (years, months, days) between two calendar dates.
1. Calculating Age from Date of Birth
Assuming Birthdate is in cell B2:
=DATEDIF(B2, TODAY(), "Y") & " years old"
2. Complete Detailed Tenure String
=DATEDIF(A2, B2, "Y") & "y " & DATEDIF(A2, B2, "YM") & "m " & DATEDIF(A2, B2, "MD") & "d"
- Example Output:
"5y 8m 14d"
?
Frequently Asked Questions
Why do I get #NUM! in DATEDIF?
DATEDIF throws #NUM! if start_date is later than end_date. Ensure start_date <= end_date.