Solved

Excel Pivot Table "bug"?

Posted on 2010-08-24
5
416 Views
Last Modified: 2012-05-10
I have an Excel pivot table that is acting very strangely in Excel 2007 - SP2.  I've never seen this before.  When I first created the pivot table, I noticed one of the entries showing up as "-5.32907E-15".  When looking at the detail, this field should have been zeros.  So, then I added another level of detail below the total.  When I expand the detail, I get a zero total, but when I collapse it, I get the above value.

Anyone seen anything like this before?


0
Comment
Question by:cjagger
  • 3
  • 2
5 Comments
 

Author Comment

by:cjagger
ID: 33511783
Attached is a very simple spreadsheet that I created that shows the problem.
excelbroke.xls
0
 
LVL 92

Expert Comment

by:Patrick Matthews
ID: 33511848
It's not a bug--it's a quirk in how Excel (and Access, VBA, and many other apps) do floating point math.The short version: the IEEE standard many apps use for floating point arithmetic cannot capture every single number to an arbitrary level of precision, which leads to situations like you see above, where you expect an operation to return a zero value, but you instead get a very tiny but non-zero value.
0
 
LVL 92

Accepted Solution

by:
Patrick Matthews earned 125 total points
ID: 33511870
For more info, you can get several good explanations here:http://www.bing.com/search?q=excel+ieee+floating+point&src=IE-SearchBox&FORM=IE8SRC
0
 

Author Comment

by:cjagger
ID: 33511908
That is very strange.  In all the Excel workbooks I've done, I've never seen this before.  Thanks for the explanation and the resource!
0
 
LVL 92

Expert Comment

by:Patrick Matthews
ID: 33512665
cjagger,You're most welcome!It is why sometimes in VBA code, instead of a test like this:    If VarA - VarB = 0 Thenyou instead see:    If Abs(VarA - VarB) < 0.0000000001 Then:)Patrick
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

No matter the version of Windows you are using, you may have some problems with Windows Search running too slow or possibly not running at all. Before jumping into how you can solve this issue, just know there are many other viable alternative deskt…
Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now