PDA

View Full Version : managing display of "days"



bpt2
22-07-2009, 02:21 AM
=INT(B23) & " years, " & INT(MOD(B23,1)*12) & " months, " &
MOD(B23*365,30) & " days"
The above formula displays years, months and days of number in cell B23. It actually looks like this:
18 years, 2 months, 17.0210378829897 days. How can I limit the decimal places for "days"?

MushHead
22-07-2009, 10:19 AM
Try something like

=INT(B23) & " years, " & INT(MOD(B23,1)*12) & " months, " & ROUND(MOD(B23*365,30),2) & " days"

That example gives 2 decimal places using the ROUND function.

bpt2
22-07-2009, 12:23 PM
Thanks