+ Reply to Thread
Results 1 to 11 of 11

Summing pivot fields where value is 1

  1. #1
    Registered User
    Join Date
    05-13-2013
    Location
    Portland, Oregon
    MS-Off Ver
    Excel 2010
    Posts
    6

    Question Summing pivot fields where value is 1

    I have a report series for monthly injuries reported at all my company's locations. I filter by location and display the injury types and the number of each, as per the sample workbook attached. From this, a pie chart is built for each location.

    The problem is that there are always so many one-shot injury types (we encourage reporting of every single incident, no matter how minor) that an automatic pie chart invariably includes so many tiny slivers that the chart is impossible to read. I've been manually summing the single incidents, copying it and the rest of the injury data to another location in the worksheet, and building the pie chart from that.

    When these reports were done on an ad-hoc, by-request basis, I could afford the time to monkey with the single incidents, but now I have to make the reports monthly, and there are nearly 70 locations involved. Is there a way to make injury types of "1" sum up into a "Miscellaneous" field automatically within the pivot table? (I'm using Excel 2010.)
    Attached Files Attached Files

  2. #2
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Summing pivot fields where value is 1

    so I'm not sure how to tell you how I did this....but here goes....
    1) first group your misc data....highlight the misc items and right click and choose group.
    2) click on the "-" sign to collapse the group.
    3) change the name of the group to "Whatever you want"....click in the field and start typing
    4) highlight the Injury type 2 fields AND the count of injury totals and create the pie chart...
    5) set your data labels appropiately....

    Check out the file....HTH
    Attached Files Attached Files
    Ernest

    Please consider adding a * if I helped

    Nothing drives me crazy - I'm always close enough to walk....

  3. #3
    Registered User
    Join Date
    05-13-2013
    Location
    Portland, Oregon
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Summing pivot fields where value is 1

    Thanks very much for the reply, judgeh59!

    However, I'm concerned about the changing nature of the data from month to month. Not all the same injuries will occur each month, and they will occur in various numbers. How do I ensure that only the single injuries get into that grouping each month?

  4. #4
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Summing pivot fields where value is 1

    if there is a different PT for each month then you can choose (collect) the "1"s. If it the same PT all you have to do is ungroup then re-group the "1"s...

  5. #5
    Registered User
    Join Date
    05-13-2013
    Location
    Portland, Oregon
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Summing pivot fields where value is 1

    But doesn't this mean that I have to go in and perform this processing each month? If so, I'm not sure that's going to help me very much, as it would be almost as time-consuming to do that for 70 locations as it is to manually sum the "misc"'s. Or perhaps I am not understanding the process correctly?

  6. #6
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Summing pivot fields where value is 1

    I see your point....you could use a COUNTIF function to count the "1"s....then when you update all your PT it should flow to the pivot chart....does that make sense?

  7. #7
    Registered User
    Join Date
    05-13-2013
    Location
    Portland, Oregon
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Summing pivot fields where value is 1

    Yes, it makes sense. Using a COUNTIF was something I was considering, but I couldn't figure out how to implement it properly. If you know how it should be done, I could use some guidance.

  8. #8
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Summing pivot fields where value is 1

    =COUNTIF(B4:B50,"=1")
    put this in the D6 cell..."Misc Single Incidents"

    you can set the range "B4:B50" to as far down as you want....this is not a very elegant solution for the range....you can use a named range (or dynamic name range), which is a little neater...so this should be fairly dynamic when you change you filter to see each location....

  9. #9
    Registered User
    Join Date
    05-13-2013
    Location
    Portland, Oregon
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Summing pivot fields where value is 1

    Thanks! I was able to create a dynamic named range and the COUNTIF formula works for totaling up the single miscellaneous incidents.

    Now what I'm trying to figure out is how to get all the information lined up properly for a pie chart to display it. What's the best way to build a table that displays the injury types and numbers for those injuries that are greater than 1, and then just the name "Misc Single Incidents" and the sum of the all the rest?

  10. #10
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Summing pivot fields where value is 1

    can you upload what you have done so far....I thought in your upload you had the three all together...so I am bit confused....thanks

  11. #11
    Registered User
    Join Date
    05-13-2013
    Location
    Portland, Oregon
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Summing pivot fields where value is 1

    My original upload was simply a pivot table that filtered injury data by location and dumped the injury types and their totals. My original question was about how to force the summing of all the one-shot injuries into a single "miscellaneous category," which we've accomplished.

    However, the ultimate goal is to create an automatically-generated display of this data that will yield a usable pie chart. As it stands, I haven't figured out a way to get that clean display. For example, in the latest version of the workbook, the pivot table is displaying one injury type at 10, another at 4, four others at 2, and five at a value of 1. My goal is to find a way to make a table that shows the injury types at 10, 4, and 2 broken out by name, and all the single injury types lumped together as "miscellaneous" with a cumulative total.

    Thanks for your continued help.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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