Summing unknown number of duplicates in dataset

jdmc45

Board Regular
Joined
May 8, 2011
Messages
146
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have a dataset, column A are ID numbers and column B are codes. When the is a duplicate ID and code from the next row, I want to sum a certain column C as many duplicates as there are. So for example, dataset could look like

A B C
123 abc 1
123 abc 4
123 bg 3
356 fh 5

I want to sum the 123, abc values in column C, that is, number 5. The problem is there isn't always just one duplicate but sometimes many, how would I go about this problem?

Thanks!
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Try
=SUMPRODUCT(--(A1:A100=123), --(B1:B100="abc"), C1:C100)

or if you have Excel 2007 or later

=SUMIFS(C:C, A:A, 123, B:B, "abc")
 
Upvote 0
Try
=SUMPRODUCT(--(A1:A100=123), --(B1:B100="abc"), C1:C100)

or if you have Excel 2007 or later

=SUMIFS(C:C, A:A, 123, B:B, "abc")

Thanks for that, but for the unique combination of ID and code the sum will be the same, is there a way to filter out the duplicate sum and return only one sum per unique combination of ID and code?

Cheers!
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

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