Combine rows with same data and sum data

EvansRJ

New Member
Joined
May 10, 2011
Messages
13
Office Version
  1. 2016
Platform
  1. Windows
Good Afternoon,

Can someone please tell me how to combine the following data...

Issue TypeShipment TypeCount ClosedCount Open
UserPO339
UserPO01
UserPO11
UserPO232
UserPO340

Assuming Rows 1-6 and Columns A-D, how to I get a result where it combines the columns with the same name (A&B) and sums columns C&D. So the final result would be this...

UserPO9113

Thank you!
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
with Power Query
Issue TypeShipment TypeCount ClosedCount OpenIssue TypeShipment TypeCount ClosedCount Open
UserPO339UserPO9113
UserPO01
UserPO11
UserPO232
UserPO340

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Group = Table.Group(Source, {"Issue Type", "Shipment Type"}, {{"Count Closed", each List.Sum([Count Closed]), type number}, {"Count Open", each List.Sum([Count Open]), type number}})
in
    Group
 
Upvote 0
with Power Query
Issue TypeShipment TypeCount ClosedCount OpenIssue TypeShipment TypeCount ClosedCount Open
UserPO339UserPO9113
UserPO01
UserPO11
UserPO232
UserPO340

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Group = Table.Group(Source, {"Issue Type", "Shipment Type"}, {{"Count Closed", each List.Sum([Count Closed]), type number}, {"Count Open", each List.Sum([Count Open]), type number}})
in
    Group
Thank you... with respect, I have no idea what this means. I have figured out where to find Power Query (Get Data) in Excel but no idea how to manipulate it to get the results you show. Can you explain?
 
Upvote 0
I have Office 2016 however it is my Corporate laptop so hopefully the tools I will need are enabled.
 
Upvote 0
XL2016 has Power Query built-in
your source data should be an Excel Table (check the name)
Data - New Query - From Other Source - Blank Query
open Advanced Editor and replace all there with code copied from the post
check if the name in first line (here: Table1) is the same as your source table, if not update first line
Close&Load
 
Upvote 0
I receive and error when I follow your steps.

Expression.Error: The column 'Issue Type' of the table wasn't found.
Details:
Issue Type
 
Upvote 0
so you posted improper table in the first post, check headers and fix it

use XL2BB to post your original source table
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top