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

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
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,223,705
Messages
6,173,985
Members
452,540
Latest member
haasro02

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