SOLVED

Summing (SUMIFS) with a Pivot Table and Manual Table. Easier Method?

%3CLINGO-SUB%20id%3D%22lingo-sub-2532005%22%20slang%3D%22en-US%22%3ESumming%20(SUMIFS)%20with%20a%20Pivot%20Table%20and%20Manual%20Table.%20Easier%20Method%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2532005%22%20slang%3D%22en-US%22%3E%3CP%3EI%20need%20assistance%20with%20making%20a%20process%20easier%2C%20if%20possible.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20take%20raw%20data%20from%20a%20salary%20file%2C%20make%20a%20Pivot%20Table%20from%20it%20to%20sum%20it%2C%20I%20also%20have%20manual%20inputs%20for%20changes%20to%20personnel%20that%20affect%20the%20forecasted%20persons%20leaving%20(in%20the%20example%20I%20only%20use%20current%20months%20but%20real%20summary%20has%20future%20months%20for%20forecast)%2C%20then%20I%20have%20a%20last%20built%20table%20that%20finally%20sums%20what%20came%20from%20the%20Pivot%20as%20actuals%20and%20my%20forecasted%20(manual%20input%2Ftyped%20in%20J2%3AN9%20with%20formulas%20in%20yellow%20to%20automate%20for%20me).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20use%20SUMIFS%20in%20each%20one%20but%20this%20is%20sort%20of%20tedious%20to%20manage%20(I%20need%20more%20lines%20and%20then%20I%20have%20to%20fix%20the%20SUMIFS%20sum%20columns%20or%20other%20columns%2C%20and%20hope%20to%20be%20able%20to%20pivot%20this%20data%20in%20that%20final%20third%20table.%20Is%20there%20an%20easier%20way%20to%20do%3F%20I%20want%20to%20be%20able%20to%20sum%20these%20up%20quickly%2C%20Pivot%20it%20so%20it%20adds%20up%20correctly.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20thought%20about%20breaking%20the%20Pivot%20into%20one%20tab%2C%20the%20manual%20input%20into%20another%2C%20Pivot%20the%20manual%20input%2Fforecasted%2C%20then%20sum%20both%20Pivots%20into%20one.%20I%20can't%20put%20the%20manual%20information%20in%20the%20original%20raw%20data%20because%20the%20format's%20are%20different%20and%20I'm%20given%20the%20data%20this%20way.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%221.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F294619iB56B2857EFE1B620%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%221.png%22%20alt%3D%221.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%E2%80%83%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F294620iCF2F5874CA77810C%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%222.png%22%20alt%3D%222.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%E2%80%83%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2532005%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ECharting%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2532779%22%20slang%3D%22en-US%22%3ERe%3A%20Summing%20(SUMIFS)%20with%20a%20Pivot%20Table%20and%20Manual%20Table.%20Easier%20Method%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2532779%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F830570%22%20target%3D%22_blank%22%3E%40Jpalaci1%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWith%20Power%20Query%3A%3C%2FP%3E%3CP%3E-%20RawData%20as%20one%20source%3C%2FP%3E%3CP%3E-%20Inputs%20as%20another%20source%20with%20appropriate%20transformations%20(Year%2C%20Month%2C%20Monthly%20salary...)%3C%2FP%3E%3CP%3E-%20Aggregation%20of%20the%20RawData%20values%3C%2FP%3E%3CP%3E-%20Merged%20with%20the%20Inputs%3C%2FP%3E%3CP%3E-%20Sum%20of%20Aggregated%20RawData%20values%20%2B%20Input%20values%3C%2FP%3E%3CP%3E%3D%26gt%3B%20As%20source%20for%20Pivot%20Table%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EUpdated%20example%20attached%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2532939%22%20slang%3D%22en-US%22%3ERe%3A%20Summing%20(SUMIFS)%20with%20a%20Pivot%20Table%20and%20Manual%20Table.%20Easier%20Method%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2532939%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F830570%22%20target%3D%22_blank%22%3E%40Jpalaci1%3C%2FA%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EOn%20reflection%20another%20PQ%20option%20much%20easier%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E-%20RawData%20as%20one%20source%3C%2FP%3E%3CP%3E-%20Inputs%20as%20another%20source%20with%20appropriate%20transformations%20(Year%2C%20Month%2C%20Monthly%20salary...)%20so%20the%20fields%20are%20the%20same%20as%20the%20RawData%3C%2FP%3E%3CP%3E-%20Combined%20the%202%20tables%3C%2FP%3E%3CP%3E%3D%26gt%3B%20As%20source%20for%20Pivot%20Table%3C%2FP%3E%3CP%3ESee%20attached%20file%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2533082%22%20slang%3D%22en-US%22%3ERe%3A%20Summing%20(SUMIFS)%20with%20a%20Pivot%20Table%20and%20Manual%20Table.%20Easier%20Method%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2533082%22%20slang%3D%22en-US%22%3EThank%20you%20for%20the%20response.%20Will%20try%20today%20if%20not%20tomorrow%20and%20report%20back.%3CBR%20%2F%3E%3CBR%20%2F%3ESecond%20question.%20In%20my%20example%20I%20simplified%20it.%20In%20my%20real%20model%20I%20have%20two%20manual%20tables.%20One%20does%20salary%20and%20second%20does%20taxes%20paid%20by%20company.%20Can%20it%20still%20work%20with%20using%20the%20original%20Pivot%2C%20my%20salary%20forecast%2C%20and%20then%20my%20second%20tax%20forecast%20manual%20table%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2533254%22%20slang%3D%22en-US%22%3ERe%3A%20Summing%20(SUMIFS)%20with%20a%20Pivot%20Table%20and%20Manual%20Table.%20Easier%20Method%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2533254%22%20slang%3D%22en-US%22%3ERe.%202nd%20Question.%20If%20you%20mean%20that%20you%20add%20up%20(currently%20with%20SUMIFS)%20Salary%20%26amp%3B%20Tax%20Paid%2C%20then%20in%20theory%20you%20can%20take%20the%20same%20approach%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2534795%22%20slang%3D%22en-US%22%3ERe%3A%20Summing%20(SUMIFS)%20with%20a%20Pivot%20Table%20and%20Manual%20Table.%20Easier%20Method%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2534795%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F75890%22%20target%3D%22_blank%22%3E%40L%20z.%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20questions%20on%20how%20to%20complete%20what%20you%20did.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDid%20you%20just%20load%20the%20data%20or%20create%20a%20table%20(input%20table)%20from%20my%20manual%20inputs%3F%20Did%20you%20load%20into%20the%20data%20model%20or%20PQ%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20columns%20from%20my%20raw%20data%20and%20my%20manual%20inputs%20columns%20are%20not%20the%20same%20and%20not%20sure%20how%20I%20handle%20in%20Power%20Pivot%20like%20you%20did%20for%20the%20summary.%20How%20did%20you%20complete%20that%3F%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screen%20Shot%202021-07-10%20at%202.57.40%20PM.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F294798iBDFECADA36CACC08%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Screen%20Shot%202021-07-10%20at%202.57.40%20PM.png%22%20alt%3D%22Screen%20Shot%202021-07-10%20at%202.57.40%20PM.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%E2%80%83%3C%2FP%3E%3CP%3EI%20needed%20to%20make%20a%20second%20taxes%20table%20to%20include%20for%20a%20second%20table.%20Since%20a%20new%20salary%20triggers%20a%20tax%20is%20it%20best%20to%20just%20have%20some%20how%20to%20see%20if%20there's%20a%20salary%20make%20a%20line%20that%20multiples%20by%20the%2025%25%20tax%20rate%3F%20I%20just%20want%20to%20be%20able%20to%20load%20into%20a%20single%20summary%20like%20you%20have%20because%20my%20real%20raw%20data%20has%20both%20salaries%20and%20taxes%20so%20I%20can%20switch%20around.%20I%20don't%20know%20how%20to%20do%20the%20same%20for%20the%20forecasted%20costs.%20For%20example%2C%20in%20the%20input%20table%20you%20have%20just%20automatically%20see%20it's%20a%20salary%20account%20and%20create%20a%20new%20line%20that%20does%20the%20salary*25%25.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20for%20any%20help.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2534982%22%20slang%3D%22en-US%22%3ERe%3A%20Summing%20(SUMIFS)%20with%20a%20Pivot%20Table%20and%20Manual%20Table.%20Easier%20Method%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2534982%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F830570%22%20target%3D%22_blank%22%3E%40Jpalaci1%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELet's%20go%201st%20step%20at%20a%20time%20if%20you%20don't%20mind%3C%2FP%3E%3CP%3E1%2F%20Nowhere%20I%20used%20Power%20%3CFONT%20color%3D%22%23FF0000%22%3EPivot%3C%2FFONT%3E%20but%20Power%20%3CFONT%20color%3D%22%23339966%22%3EQuery%3C%2FFONT%3E%3C%2FP%3E%3CP%3E2%2F%20Look%20at%20sheet%26nbsp%3B%3CSTRONG%3EInputs%3C%2FSTRONG%3E%20in%20the%20file%20I%20shared.%20I%20made%20a%20copy%2Fpaste%20of%20the%20relevant%20columns%20and%20rows%20(from%20your%20manual%20inputs%20in%20sheet%26nbsp%3B%3CSTRONG%3EWorking%20Tab%3C%2FSTRONG%3E)%20and%20formatted%20the%20copied%20data%20as%20a%20Table%20that%20I%20named%20Inputs%3C%2FP%3E%3CP%3E3%2F%20I%20%22loaded%22%20the%20existing%20table%26nbsp%3B%3CSTRONG%3ERawData%3C%2FSTRONG%3E%20in%20Power%20Query%20and%20did%20the%20same%20with%20the%20newly%20created%26nbsp%3B%3CSTRONG%3EInputs%3C%2FSTRONG%3E%20table%3C%2FP%3E%3CP%3E4%2F%20In%20Power%20Query%20I%20did%20a%20couple%20of%20transformations%20so%20the%26nbsp%3B%3CSTRONG%3EInputs%3C%2FSTRONG%3E%20table%20looks%20the%20same%20as%20the%26nbsp%3B%3CSTRONG%3ERawData%3C%2FSTRONG%3E%20table%3C%2FP%3E%3CP%3E5%2F%20I%20combined%2Fappended%20tables%26nbsp%3B%3CSTRONG%3ERawData%3C%2FSTRONG%3E%20%26amp%3B%26nbsp%3B%3CSTRONG%3EInputs%3C%2FSTRONG%3E%2C%20then%20on%20exiting%20the%20Power%20Query%20Editor%20I%20chose%20option%20Pivot%20Table%20Report%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%2C%20above%20steps%203-5%20are%20done%20in%2Fwith%20Power%20Query.%20Within%20Excel%3A%20Go%20to%20Data%20tab%20%26gt%3B%20Queries%20%26amp%3B%20Connections%20(this%20will%20open%20the%20corresponding%20pane%20on%20the%20right%20and%20you'll%20see%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Demo.png%22%20style%3D%22width%3A%20202px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F294806i8AEF6836B4FBADC6%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Demo.png%22%20alt%3D%22Demo.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26gt%3B%20Double-click%20on%20i.e.%20Inputs%20and%20the%20Power%20Query%20Editor%20will%20open%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnd%20please%2C%20let's%20stay%20on%20the%20same%20page%2Fpicture%20%3D%26gt%3B%20Use%20the%20file%20attached%20to%20this%20reply%2C%20it's%20an%20easier%20version%20of%20the%201st%20I%20posted%3C%2FP%3E%3C%2FLINGO-BODY%3E
Contributor

I need assistance with making a process easier, if possible. 

 

I take raw data from a salary file, make a Pivot Table from it to sum it, I also have manual inputs for changes to personnel that affect the forecasted persons leaving (in the example I only use current months but real summary has future months for forecast), then I have a last built table that finally sums what came from the Pivot as actuals and my forecasted (manual input/typed in J2:N9 with formulas in yellow to automate for me).

 

I use SUMIFS in each one but this is sort of tedious to manage (I need more lines and then I have to fix the SUMIFS sum columns or other columns, and hope to be able to pivot this data in that final third table. Is there an easier way to do? I want to be able to sum these up quickly, Pivot it so it adds up correctly.

 

I thought about breaking the Pivot into one tab, the manual input into another, Pivot the manual input/forecasted, then sum both Pivots into one. I can't put the manual information in the original raw data because the format's are different and I'm given the data this way.

 

1.png

2.png

11 Replies

@Jpalaci1 

With Power Query:

- RawData as one source

- Inputs as another source with appropriate transformations (Year, Month, Monthly salary...)

- Aggregation of the RawData values

- Merged with the Inputs

- Sum of Aggregated RawData values + Input values

=> As source for Pivot Table

 

Updated example attached

@Jpalaci1 

On reflection another PQ option much easier:

- RawData as one source

- Inputs as another source with appropriate transformations (Year, Month, Monthly salary...) so the fields are the same as the RawData

- Combined the 2 tables

=> As source for Pivot Table

See attached file

Thank you for the response. Will try today if not tomorrow and report back.

Second question. In my example I simplified it. In my real model I have two manual tables. One does salary and second does taxes paid by company. Can it still work with using the original Pivot, my salary forecast, and then my second tax forecast manual table?
Re. 2nd Question. If you mean that you add up (currently with SUMIFS) Salary & Tax Paid, then in theory you can take the same approach

@L z. 

I have questions on how to complete what you did.

 

Did you just load the data or create a table (input table) from my manual inputs? Did you load into the data model or PQ?

 

My columns from my raw data and my manual inputs columns are not the same and not sure how I handle in Power Pivot like you did for the summary. How did you complete that?

Screen Shot 2021-07-10 at 2.57.40 PM.png

I needed to make a second taxes table to include for a second table. Since a new salary triggers a tax is it best to just have some how to see if there's a salary make a line that multiples by the 25% tax rate? I just want to be able to load into a single summary like you have because my real raw data has both salaries and taxes so I can switch around. I don't know how to do the same for the forecasted costs. For example, in the input table you have just automatically see it's a salary account and create a new line that does the salary*25%.

 

Thank you for any help.

 

@Jpalaci1 

Let's go 1st step at a time if you don't mind

1/ Nowhere I used Power Pivot but Power Query

2/ Look at sheet Inputs in the file I shared. I made a copy/paste of the relevant columns and rows (from your manual inputs in sheet Working Tab) and formatted the copied data as a Table that I named Inputs

3/ I "loaded" the existing table RawData in Power Query and did the same with the newly created Inputs table

4/ In Power Query I did a couple of transformations so the Inputs table looks the same as the RawData table

5/ I combined/appended tables RawDataInputs, then on exiting the Power Query Editor I chose option Pivot Table Report

 

So, above steps 3-5 are done in/with Power Query. Within Excel: Go to Data tab > Queries & Connections (this will open the corresponding pane on the right and you'll see:

Demo.png

> Double-click on i.e. Inputs and the Power Query Editor will open

 

And please, let's stay on the same page/picture => Use the file attached to this reply, it's an easier version of the 1st I posted

Thank you! I will attempt this tomorrow and get back. Thank you for all the help and going into the details.
Last question. I'm on the part to make the merge.
1) Do I make the merge as new or append as new? Which one?
2) Did you merge/append the raw data to the input or vice versa? I did both ways (after cleaning and matching columns) and only pulls the data in that table.
3) What was the primary key/foreign key? I chose company and didn't get what I needed.
4) What type of join? I did default Left Join.

Other than making the merge queries that's all I need.

Thank you.
best response confirmed by Jpalaci1 (Contributor)
Solution

@Jpalaci1 

I would suggest you spend a few minutes reading Merge, Join, Append, Combine as nowhere in what I shared there's a merge between the 2 tables/queries, hence your questions

 

Assuming you used the same tables names in Excel (RawData & Inputs)

AppendQueriesThenPivotReport.png

 

And you can select Inputs as First table and RawData as Second table, that doesn't matter in this scenario

Thank you for the assistance. And thank you for providing me the details. I will go through this is detail.


Thank you for all the help. This fixed it. I apologize for my ignorance and thank you for showing me and you patience.

Glad I could help + Thanks for posting back
And don't apologize, we all started from scratch
Nice day...