Excel’s Interesting Bug: Thoughts
Microsoft Excel 2007 has an interesting, albeit embarrassing bug.
Type the following into a shiny new spreadsheet
Press Enter and you should see the following
Then, type the following
You’d think you’d get the same result. This is where you would be wrong
Let’s try with other factors
The result?
Ok, maybe there’s something special about 77.1, 850 and multiplication.
From what I remember from school, A * B = A / (1/B). Let’s see if Excel 2007 agrees
Type the following
Then type the following formula and fill down
What do you reckon the results will be? Without further ado:
The point of this post is not to gleefully point out the bug. I have my fair share of the same! And so do you! It is to merely speculate
- What conditions in the algorithm the Excel guys used could lead to such a situation? Does it have anything to do with the number 65535, that just happens to be 2^16?
- Since the bug manifests itself in the division, it conjures up some food for thought. In the division algorithm does it actually divide or does it reduce the expression directly to multiplication?
- Where else will this beast rear its head? For instance, some formulas make use of multiplication
- Are there any other magic numbers that cause this behaviour?
- How do you test for this, short of writing tests for all permutations of numbers being added/divided/multiplied/subtracted?














Modified

Ntwiga says:
Added on September 25th, 2007 at 2:32 pmNice, did you find this yourself?
By the way, I tried this in Excel 2003 and the bug does not exist.
Dare I suggest that this is an artifact of integer (vs. float) variables for the math: Excel 2007 is probably trying to carry out the operations using integers and is getting messed up when the result overflows.
Debasis Pradhan says:
Added on September 26th, 2007 at 2:53 pmHi, you have done a nice investigation on the bug! Here is a link to a post, which throws more insights into the bug - http://software-testing-zone.blogspot.com/2007/09/multiplication-bug-in-microsoft-excel.html . Hope you would like it!
-Debasis
Ntwiga says:
Added on September 26th, 2007 at 5:26 pmThinker,
An update just came in from the mothership.