Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Condensing a list with duplicates to a list with non-duplicates

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

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 169
Default Condensing a list with duplicates to a list with non-duplicate

You could just use a pivot table with FOOD in the Row and SUM of QUANTITY in
the data section.

If you need more analysis or manipulation and your list is long, you can
still use a Pivot table on FOOD to generate a list of unique values and then
use that as the key for SUMIFs, COUNTIF, etc.
--
Tips for Excel, Word, PowerPoint and Other Applications
http://www.kan.org/tips


"John" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
validation list with no duplicates Rodrigo Ferreira Excel Discussion (Misc queries) 2 March 16th 07 06:07 PM
Array Formulas - Unique List from List with Duplicates Johnny Meredith Excel Discussion (Misc queries) 7 October 27th 06 09:26 PM
removing duplicates from a list aleccamp Excel Discussion (Misc queries) 4 November 20th 05 03:22 AM
How to remove duplicates from a list and copy new list to new colu Chance Excel Worksheet Functions 2 April 23rd 05 05:21 AM
How do I find duplicates in a list JimNC Excel Discussion (Misc queries) 1 February 6th 05 08:40 PM


All times are GMT +1. The time now is 10:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"