ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Simple Rounding Problem (https://www.excelbanter.com/excel-discussion-misc-queries/16098-simple-rounding-problem.html)

Lisa

Simple Rounding Problem
 
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.

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

"Lisa" wrote in message
...
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.




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.

"Lisa" wrote:

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.


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


"Lisa" wrote in message
...
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.





All times are GMT +1. The time now is 03:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com