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!
 

Some videos you may like

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

sandy666

Banned - Rules violations
Joined
Oct 24, 2015
Messages
7,499
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
 

EvansRJ

New Member
Joined
May 10, 2011
Messages
13
Office Version
  1. 2016
Platform
  1. Windows
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?
 

sandy666

Banned - Rules violations
Joined
Oct 24, 2015
Messages
7,499
what is you excel version?
update your profile about it
 

EvansRJ

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

ADVERTISEMENT

I have Office 2016 however it is my Corporate laptop so hopefully the tools I will need are enabled.
 

sandy666

Banned - Rules violations
Joined
Oct 24, 2015
Messages
7,499
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
 

EvansRJ

New Member
Joined
May 10, 2011
Messages
13
Office Version
  1. 2016
Platform
  1. Windows
I receive and error when I follow your steps.

Expression.Error: The column 'Issue Type' of the table wasn't found.
Details:
Issue Type
 

sandy666

Banned - Rules violations
Joined
Oct 24, 2015
Messages
7,499
so you posted improper table in the first post, check headers and fix it

use XL2BB to post your original source table
 

Watch MrExcel Video

Forum statistics

Threads
1,123,324
Messages
5,600,956
Members
414,417
Latest member
Nobu

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
Top