I dont understand....

T

TOM

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
 
R

Ron Rosenfeld

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top