# Convert Numbers (Days) to To Year/Month

Options
Overachievers Alumni
edited 12/09/19

I'm trying to convert number of days to year and month. In excel I would use the following formula

=DATEDIF(0,[Days closed]11,"y") &" years, "&DATEDIF(0,[Days closed]11,"ym") &" months"

Though this formula does not work in smartsheet is there another way to do this

Tags:

• ✭✭✭✭✭✭
Options

Exactly how are you wanting the data to be displayed?

• Overachievers Alumni
Options

I would like it to look something like 3year and 2 month

• ✭✭✭✭✭✭
Options

Try something along the lines of

=INT(Days@row / 365) + " years" + ROUND((Days@row - (INT(Days@row / 365) * 365)) / 12) + " months"

• ✭✭
Options

@Paul Newcome When I try the formula you note above, it is not calculating correctly for me. For example I have "120" which is selected in the "days@row" which on my sheet is "duration@row" as you have above, but the result is 0 years 10 months.

• Options

Hi @LS

Did you figure out how to do it? Thank you!

• ✭✭
Options

The following modified formula works

=INT(Days@row / 365) + " years " + ROUND((Days@row - (INT(Days@row / 365) * 365)) / (365 / 12)) + " months"

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!