Sum Duplicate Rows in Excel

No_Hedge

New Member
Joined
Jul 6, 2017
Messages
2
Hello,

I'm tracking truck deliveries. I have a dynamic data set. I want to consolidate the data and sum duplicate lines. Below is my example:

CONCAT CodeDelivery DateCustomerOriginDestinationLine #Carrier
7/6/2017Oil Co.
HoustonDallas1Energy Transport
7/6/2017Fuel Ltd.Oklahoma CityKansas City1Tanker Co.
7/6/2017Oil Co.HoustonDallas1Energy Transport
7/6/2017Oil Co.HoustonDallas1Fuel Delivery
7/6/2017Fuel Ltd.Oklahoma CityKansas City1Tanker Co.

<tbody>
</tbody>

I want to sum/count the "Line #" column for duplicate rows. I'm not too worried about deleting duplicate rows as once counted I can clear all duplicates in the data set. I do have a CONCAT code in Column A in order to make referencing easier. Any help is much appreciated!
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Welcome to the forum!

You can use a SUMPRODUCT function to find the sum of rows that match in columns B:G (with the exception of F/Line#). This is entered as an array, so may take a bit if you have a large data set. It would only be valid prior to deleting rows, so you'd have to hand type the number into line number manually. You could also create a macro to do all of this work for you. (depending on your comfort and skill level)


Excel 2010
ABCDEFGH
1CONCAT CodeDelivery DateCustomerOriginDestinationLine #Carrier
27/6/2017Oil Co.HoustonDallas1Energy Transport2
37/6/2017Fuel Ltd.Oklahoma CityKansas City1Tanker Co.2
47/6/2017Oil Co.HoustonDallas1Energy Transport2
57/6/2017Oil Co.HoustonDallas1Fuel Delivery1
67/6/2017Fuel Ltd.Oklahoma CityKansas City1Tanker Co.2
Sheet1
Cell Formulas
RangeFormula
H2{=SUMPRODUCT(--(B:B=B2),--(C:C=C2),--(D:D=D2),--(E:E=E2),--(G:G=G2),F:F)}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
CalcSux78,

This is definitely in the right direction. Since I have the identifying information concatenated in Column A, would the function look like the below?

{=SUMPRODUCT(--(A:A=A2),F:F)}

I am pretty comfortable with macros and VBA. Funny you mention it...I'm actually probably going to code a macro to apply the function and delete duplicates after function is applied. Sort of a workaround.
 
Upvote 0

Forum statistics

Threads
1,214,927
Messages
6,122,311
Members
449,080
Latest member
jmsotelo

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