Forum Discussion
LL19911695
Jun 22, 2022Copper Contributor
Removing decimals in a MOD formula
I am trying to create a formula which returns the average length of time in years and months from a data set. In column Z of my dataset I have lengths of time in months. In a new cell on a sep...
- Jun 22, 2022
LL19911695 Like this perhaps?
=INT(B6/12) & " years and " & TEXT(MOD(B6,12),"0") & " months"
Alternatively:
=INT(B6/12) & " years and " & ROUND(MOD(B6,12),0) & " months"
Riny_van_Eekelen
Jun 22, 2022Platinum Contributor
LL19911695 Like this perhaps?
=INT(B6/12) & " years and " & TEXT(MOD(B6,12),"0") & " months"
Alternatively:
=INT(B6/12) & " years and " & ROUND(MOD(B6,12),0) & " months"
- LL19911695Jun 22, 2022Copper ContributorThat worked, thank you 🙂
- Riny_van_EekelenJun 22, 2022Platinum Contributor
LL19911695 Obviously, you can also wrap the MOD function in INT, similar to the year portion. Though, that would result in 9.