Calculate Age in Excel
If you want to calculate age in years, months, days, hours, minutes, and seconds using Excel, follow these steps:
Steps:
- Enter the birth date in cell
A1
. - In another cell where you want the age to be displayed, enter the following formula:
=DATEDIF(A1, TODAY(), "Y") & " Years, " & DATEDIF(A1, TODAY(), "YM") & " Months, " & DATEDIF(A1, TODAY(), "MD") & " Days, " & TEXT(NOW()-A1,"h") & " Hours, " & TEXT(NOW()-A1,"m") & " Minutes, " & TEXT(NOW()-A1,"s") & " Seconds"
Explanation:
DATEDIF(A1, TODAY(), "Y")
calculates the number of complete years.DATEDIF(A1, TODAY(), "YM")
calculates the number of months after the last complete year.DATEDIF(A1, TODAY(), "MD")
calculates the number of days after the last complete month.TEXT(NOW()-A1,"h")
calculates the number of hours since the last complete day.TEXT(NOW()-A1,"m")
calculates the number of minutes since the last complete hour.TEXT(NOW()-A1,"s")
calculates the number of seconds since the last complete minute.
Example:
Assume the birth date is January 1, 1990.
Cell A1:
01/01/1990
Cell B1:
=DATEDIF(A1, TODAY(), "Y") & " Years, " & DATEDIF(A1, TODAY(), "YM") & " Months, " & DATEDIF(A1, TODAY(), "MD") & " Days, " & TEXT(NOW()-A1,"h") & " Hours, " & TEXT(NOW()-A1,"m") & " Minutes, " & TEXT(NOW()-A1,"s") & " Seconds"
This will output something like:
34 Years, 4 Months, 28 Days, 10 Hours, 45 Minutes, 30 Seconds