Why 100 - 98.362 = 1.638000..010...?

N8HJOH

New Member
Joined
May 1, 2018
Messages
2
I get lots of help from here. It's about time I get help by asking a question instead of just looking up.

I have below a value and a formula entered in the cells as below.

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD]98.362[/TD]
[TD]=100-B1[/TD]
[/TR]
</tbody>[/TABLE]

And, the value returned in the cell, B1, is 1.63800000000001, not 1.638.

Has anyone seen this?
How can this be fixed?

My remedy is to use the formula, =100-B1-10^-14, just for this operation for now.
It seems so bizarre. Who knew subtraction can be more than meets the eye?
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Hi,

Also, you can use ROUND function to whatever decimal/digits you want:


Book1
AB
198.3621.638
Sheet29
Cell Formulas
RangeFormula
B1=ROUND(100-A1,3)
 
Upvote 0
My remedy is to use the formula, =100-B1-10^-14, just for this operation for now.
It seems so bizarre. Who knew subtraction can be more than meets the eye?

Does
=100-ROUND(A1,3)
not work for you rather than
=100-B1-10^- 14
Btw I am assuming that your formula should have been A1 rather than B1.
 
Upvote 0
=100-A1 is correct. Round should work. Looks like I could add this as another example to the referred wiki page.

Thanks, all, for your help!
 
Upvote 0
Just FYI, there's a difference between Rounding Before and After the subtraction:

Cells formatted to show 14 digits after decimal:


Book1
ABC
198.3621.638000000000001.63800000000001
Sheet29
Cell Formulas
RangeFormula
B1=ROUND(100-A1,3)
C1=100-ROUND(A1,3)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top