Aggregating rows on keys and incrementing the count

hechesspee

New Member
Joined
Aug 16, 2020
Messages
10
Office Version
  1. 365
Platform
  1. Windows
Hi,
I have the below data as input. I.e. multiple occurrences of Batchid, key, duration and units with varying line_number.
BatchIdline_numberkeydurationunits
BatchId1234
173​
XY49682932
33​
1​
BatchId1234
174​
XY49682933
60​
1​
BatchId1234
175​
XY49682933
60​
1​
BatchId1234
78​
XY53931814
14​
1​
BatchId1234
165​
XY53931814
14​
1​
BatchId5678
639​
XY37078370
2​
1​
BatchId5678
640​
XY37078370
2​
1​
BatchId5678
717​
XY52469026
18​
1​
BatchId5678
718​
XY52469026
18​
1​
BatchId9012
8​
XY54273628
15​
1​
BatchId9012
9​
XY54273628
15​
1​
BatchId9012
10​
XY54273628
15​
1​
BatchId9012
11​
XY54273628
15​
1​
BatchId9012
12​
XY54273628
15​
1​

I want to get the below as output. i.e. if there is one occurence of Batchid, key, duration and units, retain as-is. If there are multiple occurrences, then aggregate it in units column.
BatchIdline_numberkeydurationunits
BatchId1234
173​
XY49682932
33​
1​
BatchId1234
174​
XY49682933
60​
2​
BatchId1234
78​
XY53931814
14​
2​
BatchId5678
639​
XY37078370
2​
2​
BatchId5678
717​
XY52469026
18​
2​
BatchId9012
8​
XY54273628
15​
5​

Please advise a solution if there is one. I do not mind which line number gets retained in the output.

Thanks,
hechesspee
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Forum statistics

Threads
1,214,936
Messages
6,122,340
Members
449,079
Latest member
rocketslinger

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