Rounding error is conditional on brackets

J

JasonG

If I put these values and formulae, I get a zero total, which is what I expect

a1: 123.456
a2: 234.567
a3: 358.023

=a3-a2-a1 (gives zero exactly)

If I put this, I get a rounding error:

=(a3-a2-a1) (gives 1.42e-14)

In another spreadsheet, the error was much larger (2e-9).

Excel should give the same result either way, but it doesn't.

Does anyone know why?

Jason
 
P

Pete_UK

A very common question. It is to do with the way Excel stores
fractional values, as most decimal fractions cannot be represented
accurately in binary. Take a simple decimal example, using 2 dp:

x = 1/3 = 0.33

x + x + x = 0.33 + 0.33 + 0.33 = 0.99

which is not equal to 1.

Pete
 
N

Niek Otten

Hi Jason,

Look here:

http://support.microsoft.com/kb/78113

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

| If I put these values and formulae, I get a zero total, which is what I expect
|
| a1: 123.456
| a2: 234.567
| a3: 358.023
|
| =a3-a2-a1 (gives zero exactly)
|
| If I put this, I get a rounding error:
|
| =(a3-a2-a1) (gives 1.42e-14)
|
| In another spreadsheet, the error was much larger (2e-9).
|
| Excel should give the same result either way, but it doesn't.
|
| Does anyone know why?
|
| Jason
 

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