+ Reply to Thread
Results 1 to 7 of 7

Pivot Table will not sum filtered positive and negative time values together

  1. #1
    Registered User
    Join Date
    05-07-2012
    Location
    Jeddah
    MS-Off Ver
    Excel 2010
    Posts
    15

    Pivot Table will not sum filtered positive and negative time values together

    Dear Friends

    I'm in desperate need for help , as I have to deliver a report in the coming two days

    I work in healthcare management and I prepared an excel sheet for the time of attendance of physicians compared to the scheduled clinic start time , then I used pivot table to segregate each type of scheduled time alone ( clinics have 4 scheduling times 9, 9:30, 17:00, 16:30) ... to calculate the average delay time compared to each type of scheduled starting time, I reviewed the formatting of the cells and everything , I also used the 1904 timing option so I can calculate negative values too , as sometime the physician will start earlier than the scheduled time, so here is the thing ... when pivot table extracts the data , they are accurate , but when it adds them together it comes up with a larger number as shown in the pivot table page in the attached excel sheet , the cells shows accurate numbers but the subtotals are extremely large numbers compared to the cells ...... and the weird thing is ..... this happen for certain clinic starting time , while the other clinic times appear accurate and calculate accurately as subtotals too ... Help plz

    I also noticed that the problem is when there are both positive and negative values ......... pivot table has a problem calculating averages from positive and negative time values .... and when I manipulated the data so that no result will be negative , the calculation turns out fine...
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Pivot Table will not sum filtered positive and negative time values together

    Hi,

    a good strategy could be to add the averages you'd need in the source data.
    As far as I know the "Average" calculation has to be done outside the pivot table, there seems to be no way the pivot will give averages for rows.

    I'm a Excel 2000 user, for Excel 2010 you can download Powerpivot add for free: maybe Powerpivot could give you better outputs.

    Regards
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon ("Add Reputation") below the post.

    Please, mark your thread [SOLVED] if you received your answer.

  3. #3
    Registered User
    Join Date
    05-07-2012
    Location
    Delhi
    MS-Off Ver
    Excel 2003 and Excel 2007
    Posts
    62

    Re: Pivot Table will not sum filtered positive and negative time values together

    If you use sum rather then Avg, it will give you correct picture.
    Also change the calculation of "After Hours time spent" as =D2-F2

  4. #4
    Registered User
    Join Date
    05-07-2012
    Location
    Jeddah
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Pivot Table will not sum filtered positive and negative time values together

    Thanks CANAPONE and Shekhar1660, So that Means that Pivot tables cannot calculate averages for filtered data that contains both positive and negative values ??

  5. #5
    Forum Contributor
    Join Date
    02-22-2011
    Location
    Rhône Alpes, France
    MS-Off Ver
    Excel 2007
    Posts
    201

    Re: Pivot Table will not sum filtered positive and negative time values together

    Hi,
    See attached the result with the right format
    Instead of hours format, use custom format [hh:mm]
    You can also check the right result in the table by using sub-total average and filter clinic start column
    Hope this helps
    Best regards
    Attached Files Attached Files

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Pivot Table will not sum filtered positive and negative time values together

    just to respond to canapone, 2007 PT's do allow for averages in the PT, right-click on 1 of the cells in that column, select "value field settings" and select average. I tested it with zeros and negative numbers and it seems to work fine.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  7. #7
    Registered User
    Join Date
    05-07-2012
    Location
    Jeddah
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Pivot Table will not sum filtered positive and negative time values together

    Oh Thanks all for your contribution , Especially jpr73 ....... and actually when I downloaded your attached sheet it looked fine , but as soon as I filtered a result in the same table or clicked on the format cell option to see what kind of format you were using ........ it instantly changed and returned back to the same errors .... and even values are still the same ...... IT REALLY AMAZES ME ..... This is very very very WEIRD.... so as soon as I click on the "Value Field Setting" in the table , go on and check the format for example ...then i get out of it , the values return errornous again , even though I did not change anything ...

+ 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