ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   precision question (https://www.excelbanter.com/excel-programming/327534-precision-question.html)

D[_5_]

precision question
 
I have a cell formula that works but the
cell displays it's output with 3 decimal pts
precision to the right. I desire only two
decimal pts to the right. How can I fix this?



Jim Thomlinson[_3_]

precision question
 
Two possible solutions... If it is just a display issue and you don't really
care how may decimals are being carried then you can right click on the
effected cell and change the formt to number and select the number of decimal
points to display.

The other solution is to use the round function. There is also a roundup,
rounddown and trunc function. To use round in this case you would do
something like...

=round(A1, 2)

Which yields 2 decimals of accuracy. You need to round when you are dealing
with money. For example...

$10.034 + 15.023 = 25.057 ...but changing the format it will look like
$10.03 + 15.02 = 25.06 which definitely looks wrong...

HTH

"D" wrote:

I have a cell formula that works but the
cell displays it's output with 3 decimal pts
precision to the right. I desire only two
decimal pts to the right. How can I fix this?




Darrin Henry[_2_]

precision question
 
If you're using VB coding then it would be:

ActiveWorkbook.Worksheets("Sheet1").Range _("A1").NumberFormat =
"$#,##0.00_);[Red]($#,##0.00)"

Where Sheet1 is your sheet, and subsitute A1 for your cells.
If you're not using VB then just, right click on the cell. Format Cell,
and use number, and then set the right precision.

NOTE: If you are using code, and don't want the $ sign, just remove them
it still works.

Darrin Henry

*** Sent via Developersdex http://www.developersdex.com ***


All times are GMT +1. The time now is 12:16 AM.

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