Sum Duplicates in Groups

Z

Zesty

I have a file that has quantity and codes. Each code has an amount, but they
are different amounts and the code duplicates many times. I need a formula
that totals each group of codes. The codes cannot be sorted so they are all
together they must be separate to keep lots together.

C = The results I would like to have.


A B C
10 AR5 10
25 AC6
25 AC6 50
15 AR5
25 AR5
25 AR5 65
12 AC6
10 AC6 22
22 XR6


Any help would be appreciated!!
Thank You
 
A

Ashish Mathur

Hi,

Assume that your data is in range A5:B13. In A4, type numbers, in B4, type
code and in C4, type Sum. In cell C5, enter

=IF(OR(B5=B6,B6=""),"",DSUM($A$4:B5,$A$4,$A$4:B5)-SUM($C3:C$4))

Hope this helps

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top