+ Reply to Thread
Results 1 to 13 of 13

Pivot table row total INCORRECT

  1. #1
    Registered User
    Join Date
    03-27-2010
    Location
    Arroyo Grande, CA
    MS-Off Ver
    Excel 2003
    Posts
    6

    Pivot table row total INCORRECT

    I am exporting data from Access into Excel and then creating a pivot table to summarize. For some reason 6 of the 6336 summarized rows has an invlaid amount in the Grand Total cell for the row ( like 4.44089209850063E-16 when it should be 0).
    I tried converting the amounts to currency on the Access side before exporting to Excel, but the six continued with non-zero amount in total cell.
    I also searched Microsoft Excel to see if there was a 'fix' for this - but, no joy, possibly because I don't know the correct terms to search under.
    I even tried exporting and creating the pivot table manually (normally everything is done via a module in the Access database). But even manualy, those 6 rows are wrong.
    This problem is ruining my results. Solutions? Thoughts?
    Last edited by Excel Novice805; 03-27-2010 at 07:34 PM. Reason: shg requested I edit, hope I did it right

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: -4.44089209850063e-16

    Welcome to the forum.

    Please take a few minutes to read the forum rules, and then amend your thread title accordingly.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Pivot table row total INCORRECT

    Your non-zero result is a floating-point precision error.

    If you had the values in Access in Currency format throughout (if Access supports it; I don't know) then it wouldn't happen.

    If you can't fix it in Access, then you'll need to round it in Excel.

  4. #4
    Registered User
    Join Date
    03-27-2010
    Location
    Arroyo Grande, CA
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Pivot table row total INCORRECT

    I rounded everything on the ACCESS side. I even created a table I dump everything into before I export to EXCEL. No joy. Still get the wrong total on the same 6. So then I went to the end of the row, typed Amount in the header row then in the first data row typed function '=ROUND($AA1,2)' without the quote marks, then copied it down into all rows. Added a new worksheet, created a pivot table and used the newly defined AMOUNT instead of the 'bad' value. Same result. That did not solve my problem.

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Pivot table row total INCORRECT

    Post a workbook?

  6. #6
    Registered User
    Join Date
    03-27-2010
    Location
    Arroyo Grande, CA
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Pivot table row total INCORRECT

    AHA! Finally found how to post a workbook. Here is my sample - I included the first entry as example of one working correctly. The rest on the pivot are wrong.
    Attached Files Attached Files
    Last edited by Excel Novice805; 03-28-2010 at 02:34 PM.

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Pivot table row total INCORRECT

    See the Here are some ways to get your question answered quickly part of the forum rules.

  8. #8
    Registered User
    Join Date
    03-27-2010
    Location
    Arroyo Grande, CA
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Pivot table row total INCORRECT

    Quote Originally Posted by shg View Post
    See the Here are some ways to get your question answered quickly part of the forum rules.
    Thank-you. And attached is a sample of my problem. Hopefully you can guide me to a solution.
    Attached Files Attached Files

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Pivot table row total INCORRECT

    OK, I see the problem, and as I said, it's a floating-point precision issue: 29.52 - 29.00 - 0.52 <> 0. Can you not just format the data as Currency or Accounting, or does that cause a problem downstream?
    Last edited by shg; 03-29-2010 at 10:23 AM.

  10. #10
    Registered User
    Join Date
    03-27-2010
    Location
    Arroyo Grande, CA
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Pivot table row total INCORRECT

    I must still be doing something wrong. On the ACCESS side the amount is defined as:
    shown in RptAmtDef. My selection query includes Round([RptAmt],2). Is there something I can set on the Excel side so it deals with the RptAmt as numeric(10.2)?
    Attached Files Attached Files

  11. #11
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Pivot table row total INCORRECT

    The data is fine in Excel.

    Quote Originally Posted by shg
    ... as I said, it's a floating-point precision issue: 29.52 - 29.00 - 0.52 <> 0

  12. #12
    Registered User
    Join Date
    03-27-2010
    Location
    Arroyo Grande, CA
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Pivot table row total INCORRECT

    OK - now I understand! Sorry to be so dense. Solution =:
    Tools - Options - Calculation - check the box 'Precision as displayed'.
    Thank-you so much for your help. Problem solved.

  13. #13
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Pivot table row total INCORRECT

    That's a setting you want to be VERY careful with. In contrast to every other thing you can do in Excel, this one actually changes the data.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1