0

I want to sum these numbers in excel:

232.270000000000000000000
252527.770000000000000000000
126285.000000000000000000000
-378856.000000000000000000000
631426.000000000000000000000
126285.000000000000000000000
126285.000000000000000000000
126287.000000000000000000000
126285.000000000000000000000
126285.000000000000000000000
126285.000000000000000000000
-1389137.000000000000000000000

the sum (i.e Sum(A1:A13) gives the following result: 190.040000000037000000

Hope you see my problem (What is this "37000000" in the decimals of my result?)

TylerDurden
  • 1,632
  • 1
  • 20
  • 30
doktoric
  • 109
  • 2
  • 10

2 Answers2

3

Rounding errors such as this one comes from using a double data type instead of a decimal data type. The result is that the calculation is run faster, but the accuracy suffers when there are many numbers after the decimal point. The only way to avoid such errors is to eliminate the floating point by multiplying and introducing it again after the calculation is done.

Jonathan Camilleri
  • 611
  • 1
  • 6
  • 17
1

This error comes because of .27 and .77 in your numbers. It's the result of floating point accuracy problems.

For example you can't represent values 0.1, 0.01 in binary. In 24-bit precision, the real value of 0.1 actually is 0.100000001490116119384765625.

So the same happens in your example.

Novarg
  • 7,390
  • 3
  • 38
  • 74