Find duplicates and sum the column

Jovinchious

New Member
Joined
Oct 12, 2022
Messages
17
Office Version
  1. 2007
Platform
  1. Windows
Hi everyone,

i need a bit of help...

in column A I have names like:
"Mike"
"Laura"
"Harry"
"Mike"
"Mike"
"Betty" etc..

and in column B are the values like:
2000
100
500 etc...

I need a code that will find all the duplicates in column A and sum their values in new column C, also keep the original "non-duplicated" names and values as they are...
Thanks!
 

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.
Book1
ABC
1NameValuesSum
2Mike20002300
3Laura100100
4Harry500500
5Mike1002300
6Mike2002300
7Betty300300
Sheet1
Cell Formulas
RangeFormula
C2:C7C2=SUMIF($A$2:$A$7,A2,$B$2:$B$7)
 
Upvote 0
Solution
For those running Excel 2010 or later versions, here is an MCode solution

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Grouped Rows" = Table.Group(Source, {"Name"}, {{"Total", each List.Sum([Values]), type number}})
in
    #"Grouped Rows"
 
Upvote 0
Thanks! Helped a lot!
After that just pressed "remove dupllicates" and thats it.
Tnx!
 
Upvote 0

Forum statistics

Threads
1,214,790
Messages
6,121,607
Members
449,037
Latest member
Arbind kumar

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