View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
John John is offline
external usenet poster
 
Posts: 2,069
Default Condensing a list with duplicates to a list with non-duplicates

I'm no expert, but I would use the Sumif() function. This would depend on
how many unique food items you have. Beside your table of items (or on a
separate sheet) put:

D1: Food
D2: Carrots
D3: Pears
D4: Apples

Assuming your table is A1:B100 (A2 to A100 has food and B2 to B100 has count)

In D2 to D3 list your unique foods (as above). In E2 put the the formula:

=SUMIF($A$2:$A$100,D2,$B$2:$B$100)

Then copy this down to E3. What is does is sums only values in the table
that have the value in D2, D3...

Hope this help...

--
Thanks - John


"Nuclear" wrote:

Assume I have this list

FOOD QUANTITY

carrots 2
pears 1
apples 3
carrots 1
apples 2

How do I create another column that lists AUTOMATICALLY the distinct FOOD's
listed and their quantities... Like so:

FOOD Total Quantity

carrots 3
pears 1
apples 5