PC Review


Reply
Thread Tools Rate Thread

Count values in a cell

 
 
terrydunne
Guest
Posts: n/a
 
      12th Jul 2005

_QUESTION
In a column where each cell has multiple text values separated b
commas, I want to count specific values. Do you know a way to do this?

_BACKGROUND
I'm in charge of a spreadsheet that tracks projects. On th
spreadsheet's DATA worksheet, the project names are listed in the firs
column and the projects' status---*-In progress-*, *-On hold-*, *-Re
flag-*, *-Complete-*---is entered in the *Status * column in the sam
row as the project name. On another worksheet, I use the COUNTI
function to count the data in the Status column (on the DATA worksheet
and build a chart from the results. For example, if the Status column i
the E column, I will have a series of functions that sa
=COUNTIF(DATA!E2:E100,":$In Progress"), =COUNTIF(DATA!E2:E100,":$O
Hold"), =COUNTIF(DATA!E2:E100,":$Red flag"), etc, to get the numbers t
build the chart. This works fine.

_*The_problem*_
Another column titled *Resources * lists, in each cell, the names of
individuals working on a project. Typically, data is entered into th
cells in this column as "Bill, George" and "Tom, Bill, George", an
"Tom, George, Mary, Bill". I want to count the number of times that
say, Bill has appeared in the Resources column for the purpose o
counting how many projects Bill is on. To do this, I have tried to us
the COUNTIF function in combination with separating the values in th
cell with commas. This doesn't work. Is there any way of separatin
these values so the COUNTIF function can pattern match specific values
to find, say, Bill and ignore the others?

If COUNTIF can't be used, I am thinking of trying a series of I
functions to return a value of TRUE if, say, Bill appears, or Georg
appears, etc, but I don't know how to count the results to get th
numbers to build a chart.

Any advice is welcome

--
terrydunn
-----------------------------------------------------------------------
terrydunne's Profile: http://www.excelforum.com/member.php...fo&userid=2516
View this thread: http://www.excelforum.com/showthread.php?threadid=38661

 
Reply With Quote
 
 
 
 
RagDyer
Guest
Posts: n/a
 
      13th Jul 2005
Say that your "Resources" column is A2 to A100.
Say you enter the name your looking to count in C1.

Try this:
=SUMPRODUCT(LEN(A2:A100)-LEN(SUBSTITUTE(A2:A100,C1,"")))/LEN(C1)

NOW ... the caveat:
IF you enter "Fred" in C1, this will *also* count:
Freddy
Freddie
Frederico
Fredric
Frederick
BUT, it will *NOT* count:
Alfred
Wilfred

So watch out for the case sensitivity!
--
HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================


"terrydunne" <(E-Mail Removed)> wrote
in message news:(E-Mail Removed)...
>
> _QUESTION_
> In a column where each cell has multiple text values separated by
> commas, I want to count specific values. Do you know a way to do this?
>
> _BACKGROUND_
> I'm in charge of a spreadsheet that tracks projects. On the
> spreadsheet's DATA worksheet, the project names are listed in the first
> column and the projects' status---*-In progress-*, *-On hold-*, *-Red
> flag-*, *-Complete-*---is entered in the *Status * column in the same
> row as the project name. On another worksheet, I use the COUNTIF
> function to count the data in the Status column (on the DATA worksheet)
> and build a chart from the results. For example, if the Status column is
> the E column, I will have a series of functions that say
> =COUNTIF(DATA!E2:E100,":$In Progress"), =COUNTIF(DATA!E2:E100,":$On
> Hold"), =COUNTIF(DATA!E2:E100,":$Red flag"), etc, to get the numbers to
> build the chart. This works fine.
>
> _*The_problem*_
> Another column titled *Resources * lists, in each cell, the names of
> individuals working on a project. Typically, data is entered into the
> cells in this column as "Bill, George" and "Tom, Bill, George", and
> "Tom, George, Mary, Bill". I want to count the number of times that,
> say, Bill has appeared in the Resources column for the purpose of
> counting how many projects Bill is on. To do this, I have tried to use
> the COUNTIF function in combination with separating the values in the
> cell with commas. This doesn't work. Is there any way of separating
> these values so the COUNTIF function can pattern match specific values,
> to find, say, Bill and ignore the others?
>
> If COUNTIF can't be used, I am thinking of trying a series of IF
> functions to return a value of TRUE if, say, Bill appears, or George
> appears, etc, but I don't know how to count the results to get the
> numbers to build a chart.
>
> Any advice is welcome.
>
>
> --
> terrydunne
> ------------------------------------------------------------------------
> terrydunne's Profile:

http://www.excelforum.com/member.php...o&userid=25160
> View this thread: http://www.excelforum.com/showthread...hreadid=386610
>


 
Reply With Quote
 
terrydunne
Guest
Posts: n/a
 
      15th Jul 2005

Thanks for the help. It took me awhile to get back to you because I
needed to update the project status spreadsheet about which I messaged
this user forum. If you recall, I wanted to count the number of
projects each person had in my department. I did not understand how to
use the solution you proposed so I used a crude solution of creating a
separate table, outside the main data table, that paired individual's
names in column headers with project names in row headers and then
inserted the word "Yes" where project and name met (if a particular
person was actually associated with a particular project). I then used
the COUNTIF function to count the instances of "Yes" to come up with a
project count for each individual. From that data I created an
impressive pie chart that was received well.

However, I would like to do this more elegantly and more dynamically.
What I don't understand about the solution you sent is where to put,
and how to count, the pattern match I am looking for. If you recall, I
am looking to match, say, the name "Roger" in a column titled
"Resources" (E2:E100) where the individual cells may have entries like
"Jim, Mary, Roger, Joe" and then count the number of times "Roger"
appears in the column and create a pie chart from the results.

To be more clear, if only the name "Roger" appeared in the cell it
would be an easy matter to count the instances of "Roger" in the
Resources column by using the COUNTIF function in a separate table that
referenced the Resources column. It's the fact that "Roger" is paired
with other names that makes the COUNTIF function useless and requires a
more sophisticated solution.

I appreciate your help in this matter and regret that I don’t
understood the solution you sent. If you can provide any additional
help, it is certainly welcome.

Thanks,
Terry


--
terrydunne
------------------------------------------------------------------------
terrydunne's Profile: http://www.excelforum.com/member.php...o&userid=25160
View this thread: http://www.excelforum.com/showthread...hreadid=386610

 
Reply With Quote
 
RagDyeR
Guest
Posts: n/a
 
      15th Jul 2005
The formula I suggested can be entered into any unused cell.

It assumes that the range that contains your multiple name entries is A2 to
A100.

Change that to E2:E100, which you stated here is your current range.
Do that change in both places in the formula.

The formula also assumes that you will enter the name you're looking to
"match" into cell C1.
That you can change to whatever cell you will use for that purpose.

This formula is case sensitive, so you must enter "Roger" in C1 *exactly* as
it's entered in your data column (upper case R).

Try this out and see if it works for you.

A formula that works around the case sensitivity, *BUT* counts *any* name
that might *contain* the looked for name (Fred will count frederick, alfred,
wilfred, freddy, ... etc.) is:

=SUMPRODUCT(LEN(E2:E100)-LEN(SUBSTITUTE(UPPER(E2:E100),UPPER(C1),"")))/LEN(C
1)

Does this clear up your questions?
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================


"terrydunne" <(E-Mail Removed)> wrote
in message news:(E-Mail Removed)...

Thanks for the help. It took me awhile to get back to you because I
needed to update the project status spreadsheet about which I messaged
this user forum. If you recall, I wanted to count the number of
projects each person had in my department. I did not understand how to
use the solution you proposed so I used a crude solution of creating a
separate table, outside the main data table, that paired individual's
names in column headers with project names in row headers and then
inserted the word "Yes" where project and name met (if a particular
person was actually associated with a particular project). I then used
the COUNTIF function to count the instances of "Yes" to come up with a
project count for each individual. From that data I created an
impressive pie chart that was received well.

However, I would like to do this more elegantly and more dynamically.
What I don't understand about the solution you sent is where to put,
and how to count, the pattern match I am looking for. If you recall, I
am looking to match, say, the name "Roger" in a column titled
"Resources" (E2:E100) where the individual cells may have entries like
"Jim, Mary, Roger, Joe" and then count the number of times "Roger"
appears in the column and create a pie chart from the results.

To be more clear, if only the name "Roger" appeared in the cell it
would be an easy matter to count the instances of "Roger" in the
Resources column by using the COUNTIF function in a separate table that
referenced the Resources column. It's the fact that "Roger" is paired
with other names that makes the COUNTIF function useless and requires a
more sophisticated solution.

I appreciate your help in this matter and regret that I don’t
understood the solution you sent. If you can provide any additional
help, it is certainly welcome.

Thanks,
Terry


--
terrydunne
------------------------------------------------------------------------
terrydunne's Profile:
http://www.excelforum.com/member.php...o&userid=25160
View this thread: http://www.excelforum.com/showthread...hreadid=386610


 
Reply With Quote
 
terrydunne
Guest
Posts: n/a
 
      18th Jul 2005

Thank you for the very helpful reply! Your solution is exactly what
want and, now that you've explained it further, I'm sure I can get i
to work--Terr

--
terrydunn
-----------------------------------------------------------------------
terrydunne's Profile: http://www.excelforum.com/member.php...fo&userid=2516
View this thread: http://www.excelforum.com/showthread.php?threadid=38661

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count of numerical values within a cell Sasikiran Microsoft Excel Misc 5 6th May 2010 03:19 PM
Count of values within a cell? jeff.fry@gmail.com Microsoft Excel Discussion 1 11th Nov 2006 12:48 AM
How to count the number of 'values' in a cell Sandih Microsoft Excel Worksheet Functions 1 11th Jul 2006 09:00 AM
Count values in a cell =?Utf-8?B?TWFyZ2FyaXRhIEN1cmJlbG8=?= Microsoft Excel Worksheet Functions 2 15th Aug 2005 06:02 PM
Count values bigger than cell =?Utf-8?B?TWljb3Mz?= Microsoft Excel Misc 5 23rd Jun 2005 01:16 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:37 PM.