Site icon ExcelNotes

How to Convert Number of Days to Years Months and Days

If you have the number of days and wonder what would be the years and months, you can use the following formula:

=DATEDIF(0,A2,"y")&" years " &DATEDIF(0,A2,"ym")&" months "&DATEDIF(0,A2,"md")&" days"

Where A2 is the cell with the number of days.

When the number of years, months or days returns 1, the above formula returns 1 years (or months, days) and that is grammarly not correct. Please use the IF Function to change from plural to singular.

=DATEDIF(0,A2, "y") & IF(DATEDIF(0,A2, "y")=1, " year ", " years ") &DATEDIF(0,A2,"ym") & IF(DATEDIF(0,A2, "ym")=1, " month ", " months ") & DATEDIF(0,A2, "md") & IF(DATEDIF(0,A2, "md")=1, " day"," days")

Exit mobile version