Solved

Excel Pivot Table "bug"?

Posted on 2010-08-24
5
439 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

740 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