View Single Post
  #15   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Coderre
 
Posts: n/a
Default Counting # of Times an Item Shows Up in a Table

Here's a possibility....if you have a list of the possible values that could
be in the list.

Assuming the list is in Cells A1:A30

B1: dog
B2: cat
etc

C1:
=SUMPRODUCT(LEN($A$1:$A$30)-LEN(SUBSTITUTE(UPPER($A$1:$A$30),UPPER(B1),"")))/LEN(B1)
Copy that formula down as far as you need

That formula returns the number of times the text in col_B appears in Col_A.

Is that something you can work with?

***********
Regards,
Ron

XL2002, WinXP-Pro


"Ralph" wrote:

yikes, Sorry Ron but I really really appreciate your help :)

"Ron Coderre" wrote:

field b2, the entry is "cat, dog, bird", in field c3 the entry is "cat,

bird"<<
Hmmm....that would have been a really nice piece of information to know
right up front.. :\

The complexity of your solution (if there is one) just increased
significantly.

We'll see what we can do for you.

***********
Regards,
Ron

XL2002, WinXP-Pro


"Ralph" wrote:

ahhhhhh!!! Thanks Ron & Bpeltzer but you are over my head with this, maybe
I'm too excel challenged but I'm finding your instructions a little too
complex for me to pull this off. An additional complexity is that in the
fields of the table I have items separated by commas, such as in field b2,
the entry is "cat, dog, bird", in field c3 the entry is "cat, bird", is this
going to screw up your ideas in terms of counting everything?? I wish I
could post the file somehow, it would make all this MUCH easier,........


"Ron Coderre" wrote:

I know you posted this in the Worksheet Functions forum, but I think a Pivot
Table might give you what you're looking for more easily:

Select your column of data (Make sure it has a col heading, I'll assume
"Type")

DataPivot Table
Use: Excel List
Range: If not already selected, select your data
Click the [Layout] button
-ROW: Type
-DATA: Count of Type
Select a destination for the Pivot Table
Click [OK]

Next, on the Pivot Table, double-click on the Type heading to view the
settings dialog.
Click the [dvance]button
Set Autosort: Descending
Using field: Count of Type
Click [OK]

That will list each unique item in the list in descending order of its count.

Does that help?

***********
Regards,
Ron

XL2002, WinXP-Pro


"Ralph" wrote:

Hi,

Is there a way to select a table and have excel produce a list ranking the #
of times each item shows up in the list, i.e.

dog 5
cat 2
bird 1
???

Thanks