ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Subtracting two 2-decimal place numbers gives result 13-decimal places? (https://www.excelbanter.com/excel-worksheet-functions/134545-subtracting-two-2-decimal-place-numbers-gives-result-13-decimal-places.html)

[email protected]

Subtracting two 2-decimal place numbers gives result 13-decimal places?
 
first cell, the value: 61179.17
second cell, the value: 67083.97
third cell, formula subtracting first cell value from the second.
instead of 95.20, the result is actually 95.19999999999710
Whats up?


David Biddulph[_2_]

Subtracting two 2-decimal place numbers gives result 13-decimal places?
 
Or it may just be the fact that those decimal numbers cannot be represented
exactly by fixed point binary numbers.
As an exercise, try to work out the binary representation of 61179.17, and
of 67083.97.
--
David Biddulph

"CLR" wrote in message
...
Probably either the first or the second cell is the result of a formula
giving the multiple decimal places and formatted to only show the
two.........

Vaya con Dios,
Chuck, CABGx3


wrote in message
ups.com...
first cell, the value: 61179.17
second cell, the value: 67083.97
third cell, formula subtracting first cell value from the second.
instead of 95.20, the result is actually 95.19999999999710
Whats up?






[email protected]

Subtracting two 2-decimal place numbers gives result 13-decimal places?
 
On Mar 12, 2:10 pm, "CLR" wrote:
Probably either the first or the second cell is the result of a formula
giving the multiple decimal places and formatted to only show the
two.........

Vaya con Dios,
Chuck, CABGx3

wrote in message

ups.com...



first cell, the value: 61179.17
second cell, the value: 67083.97
third cell, formula subtracting first cell value from the second.
instead of 95.20, the result is actually 95.19999999999710
Whats up?- Hide quoted text -


- Show quoted text -


Thanks, but I tried that . . . so I re-entered the numbers by hand
with only the two decimal places, and still get the extra significant
figures when I format the result to show them.


David Biddulph[_2_]

Subtracting two 2-decimal place numbers gives result 13-decimal places?
 
I assume that you mean 61083.97, not 67083.97, and that you mean
"subtracting second cell value from the first", not "subtracting first cell
value from the second"?

See my answer elsewhere in the thread for the explanation.
--
David Biddulph

wrote in message
ups.com...
first cell, the value: 61179.17
second cell, the value: 67083.97
third cell, formula subtracting first cell value from the second.
instead of 95.20, the result is actually 95.19999999999710
Whats up?




CLR

Subtracting two 2-decimal place numbers gives result 13-decimal places?
 
Probably either the first or the second cell is the result of a formula
giving the multiple decimal places and formatted to only show the
two.........

Vaya con Dios,
Chuck, CABGx3


wrote in message
ups.com...
first cell, the value: 61179.17
second cell, the value: 67083.97
third cell, formula subtracting first cell value from the second.
instead of 95.20, the result is actually 95.19999999999710
Whats up?




Jerry W. Lewis

Subtracting two 2-decimal place numbers gives result 13-decimal pl
 
67083.97 - 61179.17 = 5904.80, not 95.20.

As David Biddulph noted, Excel represents numbers in binary, and in binary
most terminating decimal fractions can only be approximated. As documented
in Help, the level of approximation may be accurate to no more than 15
decimal digits. If whatever calculation you actually performed still seems
wrong recognizing that you may not know what is in the 16th figure of your
input numbers, then post back with correct information.

Jerry

" wrote:

first cell, the value: 61179.17
second cell, the value: 67083.97
third cell, formula subtracting first cell value from the second.
instead of 95.20, the result is actually 95.19999999999710
Whats up?




All times are GMT +1. The time now is 10:40 AM.

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