Simple Rounding Problem

L

Lisa

How can I make the number 27.9864 look like 27.9900? I've tried a few things
and am doiwn to VB stuff which I don't quite understand so any help would be
appreciated.
 
B

Bernie Deitrick

Lisa,

If you want to change how a cell is displayed, with the number is in cell
A1, the formula

=ROUND(A1,2)

in another cell, formatted for "0.0000", will show as you desire.

If you want to change the number, the macro lines

ActiveCell.Value = Application.Round(ActiveCell.Value, 2)
ActiveCell.NumberFormat = "0.0000"

will change the activecell's actual value.

HTH,
Bernie
MS Excel MVP
 
M

Marvin P. Winterbottom

In a strict mathematics sense, 27.9864 does not round to 27.9900
The extra zeros are showing a precision that's not there.
 
J

James

Lisa,

You can use the round function for this eg Round(A1, 2) - these will round
the value in cell A1 to 2 dps

J
 
Top