Adding quantities

Closed
PMB - Jan 26, 2009 at 01:54 PM
 Helper - Feb 2, 2009 at 09:59 PM
Hello,

I want to find out simple way to consolidate quantities od similar items in the worksheet. Example, the worksheet will have data like this,

Apples 10
Oranges 20
Pears 5
Oranges 5
Pears 2
Oranges 3
Apples 5

The output should be
Apples 15
Oranges 28
Pears 7

The list can me much longer and more number of unique items. I want to find out addition of quantities for each of the items.... any help???

2 responses

kitkatcho Posts 10 Registration date Wednesday November 5, 2008 Status Member Last seen May 18, 2009 12
Jan 27, 2009 at 01:30 AM
hi,
try this link:
https://www.wisc-online.com/learn/career-clusters/stem/eng5903/excel-complex-addition
hope you get what you are searching for.
0
Thanks Kitkatcho...

In my example, these are two different columnt. One for items and other for quantity. I want to create a summery of quantity for every item. I don't think ISUM will work for this... I need to lookup all the rows with unique item name and keep adding quantities and then repeat the process for next item...
0
Assumptions:
1. Column A has headers. Sort column A to group the same products in contiguous rows.
2. Column B contains the numbers to add.


Private Sub AddQuantities_Click()

Dim i
Dim tot
i = 2

Range("A1").Select
Selection.Sort Key1:=Range("A2"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom


Do Until IsEmpty(Range("A" & i))
dup = i + 1

Do While Range("A" & i) = Range("A" & dup)

Range("B" & i) = Range("B" & i) + Range("B" & dup)
Rows(dup).EntireRow.Delete Shift:=xlUp

Loop

i = i + 1

Loop

End Sub
0