Jun 22 2022 01:23 AM
I am trying to create a formula which returns the average length of time in years and months from a data set.
My problem is, this final formula is coming back with multiple decimal places for the months portion (see below.) Is there any way I can get it to pull back the months portion with no decimals, just as it does for the years portion?
Jun 22 2022 01:35 AM - edited Jun 22 2022 01:37 AM
Solution@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"
Jun 22 2022 01:58 AM
@LL19911695 Obviously, you can also wrap the MOD function in INT, similar to the year portion. Though, that would result in 9.
Jun 22 2022 01:35 AM - edited Jun 22 2022 01:37 AM
Solution@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"