+ Reply to Thread
Results 1 to 4 of 4

SUMIFS in Pivot Table

  1. #1
    Registered User
    Join Date
    02-10-2014
    Location
    Somewhere
    MS-Off Ver
    Excel 2010
    Posts
    39

    SUMIFS in Pivot Table

    All,

    I have two tables. The first one lists the weekly requirement for specific items in specific weeks. See the example below:

    Week Item Weekly Requirement
    24 1 100
    24 2 200
    24 3 300
    25 1 110
    25 2 150
    25 3 330

    The other table lists what has actually been produced for specific items in specific weeks and on specific days. See the example below:

    Week Day Item Daily Actual
    24 13-Jun 1 19
    24 13-Jun 2 6
    24 13-Jun 3 16
    24 14-Jun 1 3
    24 14-Jun 2 18
    24 14-Jun 3 16

    I've made a pivot table out of the second table so that data can easily be examined for specific weeks and items at the daily level. I would like to add the 'Weekly Requirement' from the first table for each item and display the sum of 'Daily Actual' for the week as a percentage of the 'Weekly Requirement' for the first table. How can I do this? I was thinking of a calculated field using SumIfs in the pivot table, but I can seem to get that to work. Any ideas are much appreciated!

    Thanks in advance, I've also attached some sample data.
    Attached Files Attached Files

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: SUMIFS in Pivot Table

    Hi,

    Do you have Power Pivot available to you?
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Registered User
    Join Date
    02-10-2014
    Location
    Somewhere
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: SUMIFS in Pivot Table

    Yes, I have access.

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: SUMIFS in Pivot Table

    It is a bit of a longwinded process but here are the basic steps:

    1. Make your two data tables into actual Tables. (I named them tWeekly and tDaily)
    2. Load them into Power Pivot as linked tables.
    3. Create a new calculated column in each table using the formula: =[Week]&"|"&[Item]
    4. Create a relationship between the two tables using the new calculated column.
    5. Create a new calculated column called Weekly_Req in the daily data table using the formula: =related(tWeekly[Weekly Requirement])
    6. Create your pivot table.
    7. Add a new measure to the tDaily table using: =AVERAGE(tDaily[Weekly_Req])
    8. Lay out the pivot table with Item in the Row area and Week and Day in the column area, then add Daily Actual and Weekly_Req to the data area.
    9. You will now have the Weekly_Req repeated for each day. To get rid of that you need to create a column-based set and remove the daily entries for Weekly_Req.

    At this point your pivot table will resemble the attached.

    To be honest, if the final layout is as simple as the pivot table in your original example, where you only show one week's data, you may as well use a regular pivot table and add the Weekly_Req to your daily table using VLOOKUP or INDEX/MATCH and then just add that as a row field next to the Item field.
    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)

Similar Threads

  1. Trying to use a sumifs function on a pivot table- Thank you for your help
    By JCarollo765 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-15-2016, 12:38 AM
  2. Vlookup and sumifs or pivot table?
    By pccamara in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 11-18-2015, 12:09 PM
  3. Replies: 1
    Last Post: 07-29-2015, 05:19 PM
  4. [SOLVED] Sumifs formula referencing cell generated by slicer/pivot table
    By 3345james in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-22-2015, 03:26 PM
  5. sumifs on a pivot table - compare range with range
    By pavlos in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-30-2013, 02:26 AM
  6. Some sort of sumifs to remove pivot table
    By benoj2005 in forum Excel General
    Replies: 3
    Last Post: 09-11-2012, 04:07 AM
  7. SUMIFs pivot table by column
    By emina002 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-09-2012, 09:50 PM

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