Bug in Excel 2007

J

joeu2004

Any further word on this bug? Do I need to download a patch for this?
(It's 2013 for crying out loud, this is still an issue?)
I'm getting the following in Excel:
42.2 - 42.0 = 0.200000000000003000
Notice the "3" in the 15th position. Similarly:
42.3 - 42.1 = 0.199999999999996000
This is a HUGE problem as I have these numbers used in formulas
elsewhere in my worksheet. Truly disgraceful.

I don't have the context of the thread to which you are replying. But this
is not considered a defect. Instead, it is a limitation of the hardware
implementation that Excel relies on for numerical calculations, namely the
industry-standard 64-bit binary floating-point arithmetic.

In a nutshell, most non-integer values cannot be represented exactly
internally. And the infinitesimal differences sometimes become visible due
to arithmetic operations.

The general solution is for you to explicitly round calculations when you
require accuracy to a specific degree of precision. For example,
ROUND(42.2-42,1) and ROUND(42.3-42.1,1).

Alternatively, Excel provides the Precision As Displayed calculation option
(PAD). That automagically rounds the result of a formula to the number of
decimal places specified in the cell format.

However, I do not recommend PAD for most cases, especially a pre-existing
workbook. PAD can cause irreversible changes to some numeric constants,
which might have a sweeping effect on dependent calculations in the
workbook. Moreover, PAD alone does not remedy all problems. For example,
IF(42.2-42=0,TRUE) will still returns FALSE(!).
 
J

joeu2004

Errata.... "joeu2004 said:
Moreover, PAD alone does not remedy all problems. For example,
IF(42.2-42=0,TRUE) will still returns FALSE(!).

Well, of course! :) That should be:

IF(42.2-42=0.2,TRUE) still returns FALSE(!).
 

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