Excel’s Interesting Bug: Thoughts

Microsoft Excel 2007 has an interesting, albeit embarrassing bug.

Type the following into a shiny new spreadsheet

first

Press Enter and you should see the following

second

Then, type the following

third

You’d think you’d get the same result. This is where you would be wrong

fourth

Let’s try with other factors

fifth

The result?

sixth

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

seventh

Then type the following formula and fill down

eighth 

What do you reckon the results will be? Without further ado:

ninth

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

  1. 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?
  2. 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?
  3. Where else will this beast rear its head? For instance, some formulas make use of multiplication
  4. Are there any other magic numbers that cause this behaviour?
  5. How do you test for this, short of writing tests for all permutations of numbers being added/divided/multiplied/subtracted?

 

kick it on DotNetKicks.com

Share and Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
  • blogmarks
  • co.mments
  • del.icio.us
  • digg
  • Fark
  • feedmelinks
  • Furl
  • LinkaGoGo
  • Ma.gnolia
  • NewsVine
  • Reddit
  • TailRank
  • YahooMyWeb
 

3 responses


  1. Nice, 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.


  2. Hi, 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


  3. Thinker,

    An update just came in from the mothership.

Leave a Reply