Sum duplicate rows and delete duplicates

pdjm12

New Member
Joined
Jun 19, 2019
Messages
11
Hi

I'm working on a spreadsheet that looks like this
collumn A is the product code, B the product and C the quantity we need to sum

312apple12
652orange10
252banana3
111lemon1
652orange5
312apple8
252banana2
111lemon1
.........


And this is what I'm trying to achieve without sucess with excel vba. I tried searching the forum but I can't make it work. Is this possible? Thanks

312apple20
652orange15
252banana5
111lemon2
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
There's any number of ways you could do this. If you're OK with a non-VBA solution, (and you have 365 - you need to update your details) here's just one way:

Book1
ABCDEFGH
1Product CodeProductQuantityProduct CodeProductQuantity
2312apple12312apple20
3652orange10652orange15
4252banana3252banana5
5111lemon1111lemon2
6652orange5
7312apple8
8252banana2
9111lemon1
10
Sheet1
Cell Formulas
RangeFormula
E2:F5E2=UNIQUE(A2:B9)
G2:G5G2=SUMIFS($C$2:$C$9,$A$2:$A$9,E2,$B$2:$B$9,F2)
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,254
Members
452,624
Latest member
gregg777

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