When is 0 <> 0 ?

spleve

Board Regular
Joined
Jun 3, 2003
Messages
106
A: When you add it in excel!

Example: Place the following values in a column and sum them.

-116.33
98.53
17.80
0
=============
Excel returns: 0.0000000000000035527136788005

Correct Answer: 0

If you remove 0 from the list ( or put it in a different place in the list, the proper result, 0 is returned.

I assume this has to do with the known floating point issues, but I've never seen an example where 0<>0, so I thought I'd share.

I have a workaround, but would love to see comments...
 
Oorang said:
...The bad news is I have no idea how I will ever need this information. :lol: ...
Generally it goes something like this. A co-worker (good chance they'll be in the Finace Dept) will come to you and ask for your help trying to figure out why some reconcilation process is failing. There will be numbers coming in from two different directions, that at the end of the day should reconcile. There's some sort of a "test" either through conditional formatting or an IF() or a=b formula that is supposed to be passed before everything can be signed off. But the test is failing and your co-worker has spent hours going over every possible input and cannot see why the test is failing. Prior to knowing about FP errors you get sucked into the snipe hunt and you too spend hours doing this :banghead:. But not now! Thanks to Mr. Excel here you know about FP errors and after checking that all of the input really are okay, you'll think to just pull the difference and you'll see that the difference is something like 1.2345E-14 and you'll remember all of this and will be the hero for solving the big mystery! Anyway, that's been my experience...
 
Upvote 0

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

Forum statistics

Threads
1,222,721
Messages
6,167,841
Members
452,149
Latest member
gatje

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