Simple Loop & Sum Question

lhernandez

Active Member
Joined
May 22, 2006
Messages
282
OK, this should be an easy question, but for some reason my logic is not working.
I have a spreadsheet with approx. 900 lines. Column D has a "code" to break up the column into different groups, but the codes are scattered throughout. Column K has a quantity in it.
How can I write a loop to sum up all the values that are within a "code"?
Ex:
AAA - 2
AAA - 2
ABA - 2
ACB - 4
BBB - 7
ABA - 6
ACB - 3
BBB - 1
BBB - 1

So for all AAA sum the values and so on.
Is this possible if I do not know the code?
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Couldn't you just use a pivot table or a SUMIF formula?
 
Upvote 0

Forum statistics

Threads
1,214,922
Messages
6,122,281
Members
449,075
Latest member
staticfluids

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