Forum Home
Press F1
 
Thread ID: 101639 2009-07-21 14:21:00 managing display of "days" bpt2 (6653) Press F1
Post ID Timestamp Content User
793725 2009-07-21 14:21:00 =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 " ?
bpt2 (6653)
793726 2009-07-21 22:19:00 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.
MushHead (10626)
793727 2009-07-22 00:23:00 Thanks bpt2 (6653)
1