ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   I dont understand.... (https://www.excelbanter.com/excel-programming/303535-i-dont-understand.html)

TOM

I dont understand....
 
When I subtract this: 53,30 - 49,88 excel show this result: 3,42
but when I click to cell I see this: 3,41999999999999
Why? I need 3,42

I have got sheet where I subtract many tenth numbers and owing to this
"error" I have got bad results.

How can I correct this?

Many thanks
TOM



vtisix

I dont understand....
 
You can use =round(Ref,2)

TOM

I dont understand....
 
Of course, but why is this possible?


"vtisix" píse v diskusním príspevku
...
You can use =round(Ref,2)




Tom Ogilvy

I dont understand....
 
See Chip Pearson's page on this:

http://www.cpearson.com/excel/rounding.htm

--
Regards,
Tom Ogilvy

"TOM" wrote in message
...
Of course, but why is this possible?


"vtisix" píse v diskusním príspevku
...
You can use =round(Ref,2)






Ron Rosenfeld

I dont understand....
 
On Thu, 8 Jul 2004 14:54:13 +0200, "TOM" wrote:

When I subtract this: 53,30 - 49,88 excel show this result: 3,42
but when I click to cell I see this: 3,41999999999999
Why? I need 3,42

I have got sheet where I subtract many tenth numbers and owing to this
"error" I have got bad results.

How can I correct this?

Many thanks
TOM


Excel, like most spreadsheet programs, works in binary arithmetic and also is
limited to 15 decimal precision.

Since certain numbers cannot be expressed exactly in base 2 (binary), you will
see what you describe.

For example, certain numbers cannot be expressed exactly as decimal (base 10).
Take 1/3. No matter how many digits of precision you use, you cannot express
it exactly in Base 10. It will be 0.333333333...

So 1/3 + 1/3 +1/3 = 0.999999999... if the math is done in base 10.

To correct the problem, the simplest way is to round the result to the desired
number of decimals. Using Tools/Options/Precision as Displayed can do it also,
but that may be limiting to the rest of your worksheet.




--ron


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

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