How to Calculate Age in Microsoft Excel ?

ยท 221 words ยท 2 minute read

In the cell of age, write this =INT((TODAY()-B2)/365) where B2 is the location of the cell where the date of birth written.

This code just caclulate the number of years passed. So you know the age of this person in years.

But what if I want to know the months and days too ? ๐Ÿ”—

To get the age in years, use =DATEDIFF(dateOfBirth, TODAY(), "Y") and replace dateOfBirth by the location of the cell where the birthday are written.

To get the age in months, use =DATEDIFF(B2, TODAY(), "YM") where B2 is the cell where the birth date written.

To get the age in days, use =DATEDIFF(B2, TODAY(), "MD") where B2 is the date of birth.

But what if I want to calculate the age on a specific date ? ๐Ÿ”—

Just change the TODAY() with the date. For example: =DATEDIFF(B2, "1/4/2020", "Y") this will return the age in years calculated in April 1st, 2020.

But I need the result to be a friendly sentence ? ๐Ÿ”—

Ok, you can write it like this =DATEDIFF(B2, "1/4/2020", "Y") & " years, " & DATEDIFF(B2, "1/4/2020", "YM") & " months and " & DATEDIFF(B2, "1/4/2020", "MD") & " days." which will return 30 years, 3 months and 2 days as a result. So you can concatenate results of the functions as you saw.

Share:
waffarx cash back