Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Excel Pivot Table "bug"?

Posted on 2010-08-24
5
Medium Priority
?
465 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 93

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 93

Accepted Solution

by:
Patrick Matthews earned 500 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 93

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Cancel future meetings from user mailboxes in Office 365 using Remove-CalendarEvents
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

885 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