sum list items and consolidate duplicates

b19upj

New Member
Joined
Oct 3, 2014
Messages
34
Office Version
  1. 365
Platform
  1. Windows
Hi,
I have a list of codes (column A), and amounts of money (Column B).
I would like to sum all of the codes but where the codes are the same, only have the sum for the first instance of that code from the list.
eg see the example below
TIA

CODE AMOUNTRESULT
CAT511
DOG616
RABBIT44
FISH55
PIG77
DOG60
HAMPSTER88
GUINEA PIG33
DOG40
CAT60
HEDGEHOG55
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
How about
Excel Formula:
=IF(COUNTIF(A$2:A2,A2)=1,SUMIFS(B:B,A:A,A2),"")
 
Upvote 0
Solution
How about
Excel Formula:
=IF(COUNTIF(A$2:A2,A2)=1,SUMIFS(B:B,A:A,A2),"")
Thanks for this. I used this as an idea but changed it a little as I used a different column to do a unique count.
So my formuale was =if(countif($D9:$D9,D9)=1,1,0)
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,352
Messages
6,124,451
Members
449,161
Latest member
NHOJ

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