Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
James
 
Posts: n/a
Default Using COUNTIF for a word that is joined by another word in same ce

To make it easy, I am trying to count the number of times the name "Bob"
appears in a range of cells. Most of the time, "Bob" is the only name in the
cell, so COUNTIF would work. However, sometimes there will be 2 names in the
same cell, like this: "Joe/Bob." What kind of formula can I use to count the
number of times "Bob" appears in a range of cells, including the times there
are 2 names in the same cell? With the COUNTIF function, it is only counting
the number of times "Bob" appears alone in a cell within the range of cells.
  #2   Report Post  
TomHinkle
 
Posts: n/a
Default

Well,
unfortunately the BEST way is to seperate the names out.. one row for BOB
and one for Joe.. or several name columns...

I can't think of another function off the top of my head that will count
inside a string..
I'd try my hardest to seperate the data into multiple cols/rows, BUT if I
absolutely had to keep them together, I think the only way is to run a loop
for each value using the mid() function in VB..



"James" wrote:

To make it easy, I am trying to count the number of times the name "Bob"
appears in a range of cells. Most of the time, "Bob" is the only name in the
cell, so COUNTIF would work. However, sometimes there will be 2 names in the
same cell, like this: "Joe/Bob." What kind of formula can I use to count the
number of times "Bob" appears in a range of cells, including the times there
are 2 names in the same cell? With the COUNTIF function, it is only counting
the number of times "Bob" appears alone in a cell within the range of cells.

  #3   Report Post  
CLR
 
Posts: n/a
Default

One way would be to use a helper column with this formula, and count the 1's
in that column.........

=IF(OR(A1="bob",LEFT(A1,3)="bob",RIGHT(A1,3)="bob" ),1,"")

Vaya con Dios,
Chuck, CABGx3



"James" wrote in message
...
To make it easy, I am trying to count the number of times the name "Bob"
appears in a range of cells. Most of the time, "Bob" is the only name in

the
cell, so COUNTIF would work. However, sometimes there will be 2 names in

the
same cell, like this: "Joe/Bob." What kind of formula can I use to count

the
number of times "Bob" appears in a range of cells, including the times

there
are 2 names in the same cell? With the COUNTIF function, it is only

counting
the number of times "Bob" appears alone in a cell within the range of

cells.


  #4   Report Post  
Dave Peterson
 
Posts: n/a
Default

maybe

=countif(a1:a10,"*bob*")

But if Bob is embedded in another name, it'll get counted.

Jim/Nabob/ralph

(I couldn't think of another name!)

James wrote:

To make it easy, I am trying to count the number of times the name "Bob"
appears in a range of cells. Most of the time, "Bob" is the only name in the
cell, so COUNTIF would work. However, sometimes there will be 2 names in the
same cell, like this: "Joe/Bob." What kind of formula can I use to count the
number of times "Bob" appears in a range of cells, including the times there
are 2 names in the same cell? With the COUNTIF function, it is only counting
the number of times "Bob" appears alone in a cell within the range of cells.


--

Dave Peterson
  #5   Report Post  
CLR
 
Posts: n/a
Default

Very nice Dave.........I love that one but can never remember it
<g...........by the way, did you see that it only counts bob/bob/bob as
just one "bob"? .......of course I doubt the OP will experience that
combination, but just a curiosity.....it's apparently counting cells that it
finds a bob in rather than the bob's themselves...........

Vaya con Dios,
Chuck, CABGx3




"Dave Peterson" wrote in message
...
maybe

=countif(a1:a10,"*bob*")

But if Bob is embedded in another name, it'll get counted.

Jim/Nabob/ralph

(I couldn't think of another name!)

James wrote:

To make it easy, I am trying to count the number of times the name "Bob"
appears in a range of cells. Most of the time, "Bob" is the only name in

the
cell, so COUNTIF would work. However, sometimes there will be 2 names in

the
same cell, like this: "Joe/Bob." What kind of formula can I use to count

the
number of times "Bob" appears in a range of cells, including the times

there
are 2 names in the same cell? With the COUNTIF function, it is only

counting
the number of times "Bob" appears alone in a cell within the range of

cells.

--

Dave Peterson





  #6   Report Post  
RagDyer
 
Posts: n/a
Default

Just responded to a similar question in the excel group where the OP had
*multiple* names in a cell.

A2 to A100 contains name data.
Enter name 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!
--
Regards,

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


"CLR" wrote in message
...
Very nice Dave.........I love that one but can never remember it
<g...........by the way, did you see that it only counts bob/bob/bob as
just one "bob"? .......of course I doubt the OP will experience that
combination, but just a curiosity.....it's apparently counting cells that

it
finds a bob in rather than the bob's themselves...........

Vaya con Dios,
Chuck, CABGx3




"Dave Peterson" wrote in message
...
maybe

=countif(a1:a10,"*bob*")

But if Bob is embedded in another name, it'll get counted.

Jim/Nabob/ralph

(I couldn't think of another name!)

James wrote:

To make it easy, I am trying to count the number of times the name

"Bob"
appears in a range of cells. Most of the time, "Bob" is the only name

in
the
cell, so COUNTIF would work. However, sometimes there will be 2 names

in
the
same cell, like this: "Joe/Bob." What kind of formula can I use to

count
the
number of times "Bob" appears in a range of cells, including the times

there
are 2 names in the same cell? With the COUNTIF function, it is only

counting
the number of times "Bob" appears alone in a cell within the range of

cells.

--

Dave Peterson




  #7   Report Post  
B. R.Ramachandran
 
Posts: n/a
Default

Hi,
You could try this approach(it assumes that the name you are looking for,
e.g., Bob, occurs either alone or in two-name combinations separated by a
slash, e.g., Bob/Joe or Joe/John, AND NOT in any othr format).
Let's imagine that the first name is in A2.
Use a helper column (say B) Make sure B1 is empty (or 0)

Enter the following formula in B2 and extend it to the rest of the rows.

=B1+IF(ISNUMBER(FIND("/",A2)),IF(LEFT(A2,FIND("/",A2)-1)="Bob",1,IF(RIGHT(A2,LEN(A2)-FIND("/",A2))="Bob",1,0)),IF(A2="Bob",1,0))

The formula would succesively add the occurrence of "Bob" in any of the
three possible formats; thus, the number at the bottom of column B is what
you want.
(Note: It will exclude variations of 'Bob" and also names where "Bob" is
embedded, but is not case-sensitive - i.e., would count "Bob" and 'bob"....)

Hope it works!
Regards,
B.R. Ramachandran

"James" wrote:

To make it easy, I am trying to count the number of times the name "Bob"
appears in a range of cells. Most of the time, "Bob" is the only name in the
cell, so COUNTIF would work. However, sometimes there will be 2 names in the
same cell, like this: "Joe/Bob." What kind of formula can I use to count the
number of times "Bob" appears in a range of cells, including the times there
are 2 names in the same cell? With the COUNTIF function, it is only counting
the number of times "Bob" appears alone in a cell within the range of cells.

  #8   Report Post  
CLR
 
Posts: n/a
Default

Well, ok good,.........yours counts bob/bob/bob as 3 alright, but that
case-sensitivity stuff drives me nuts...........
when you get "older", you'll see............<g

Vaya con Dios,
Chuck, CABGx3




"RagDyer" wrote in message
...
Just responded to a similar question in the excel group where the OP had
*multiple* names in a cell.

A2 to A100 contains name data.
Enter name 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!
--
Regards,

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


"CLR" wrote in message
...
Very nice Dave.........I love that one but can never remember it
<g...........by the way, did you see that it only counts bob/bob/bob as
just one "bob"? .......of course I doubt the OP will experience that
combination, but just a curiosity.....it's apparently counting cells

that
it
finds a bob in rather than the bob's themselves...........

Vaya con Dios,
Chuck, CABGx3




"Dave Peterson" wrote in message
...
maybe

=countif(a1:a10,"*bob*")

But if Bob is embedded in another name, it'll get counted.

Jim/Nabob/ralph

(I couldn't think of another name!)

James wrote:

To make it easy, I am trying to count the number of times the name

"Bob"
appears in a range of cells. Most of the time, "Bob" is the only

name
in
the
cell, so COUNTIF would work. However, sometimes there will be 2

names
in
the
same cell, like this: "Joe/Bob." What kind of formula can I use to

count
the
number of times "Bob" appears in a range of cells, including the

times
there
are 2 names in the same cell? With the COUNTIF function, it is only

counting
the number of times "Bob" appears alone in a cell within the range

of
cells.

--

Dave Peterson






  #9   Report Post  
RagDyer
 
Posts: n/a
Default

You mean I'll "see" in, what was it, you're 3 months older then me, so I
then automatically become as "nuts" as you?<vbg
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

"CLR" wrote in message
...
Well, ok good,.........yours counts bob/bob/bob as 3 alright, but that
case-sensitivity stuff drives me nuts...........
when you get "older", you'll see............<g

Vaya con Dios,
Chuck, CABGx3




"RagDyer" wrote in message
...
Just responded to a similar question in the excel group where the OP had
*multiple* names in a cell.

A2 to A100 contains name data.
Enter name 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!
--
Regards,

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


"CLR" wrote in message
...
Very nice Dave.........I love that one but can never remember it
<g...........by the way, did you see that it only counts bob/bob/bob

as
just one "bob"? .......of course I doubt the OP will experience that
combination, but just a curiosity.....it's apparently counting cells

that
it
finds a bob in rather than the bob's themselves...........

Vaya con Dios,
Chuck, CABGx3




"Dave Peterson" wrote in message
...
maybe

=countif(a1:a10,"*bob*")

But if Bob is embedded in another name, it'll get counted.

Jim/Nabob/ralph

(I couldn't think of another name!)

James wrote:

To make it easy, I am trying to count the number of times the name

"Bob"
appears in a range of cells. Most of the time, "Bob" is the only

name
in
the
cell, so COUNTIF would work. However, sometimes there will be 2

names
in
the
same cell, like this: "Joe/Bob." What kind of formula can I use to

count
the
number of times "Bob" appears in a range of cells, including the

times
there
are 2 names in the same cell? With the COUNTIF function, it is

only
counting
the number of times "Bob" appears alone in a cell within the range

of
cells.

--

Dave Peterson






  #10   Report Post  
CLR
 
Posts: n/a
Default

LOL..........right-on RD, 3 months and counting........ <avbg)

Vaya con Dios,
Chuck, CABGx3


"RagDyer" wrote in message
...
You mean I'll "see" in, what was it, you're 3 months older then me, so I
then automatically become as "nuts" as you?<vbg
--
Regards,

RD

--------------------------------------------------------------------------

-
Please keep all correspondence within the NewsGroup, so all may benefit !
--------------------------------------------------------------------------

-

"CLR" wrote in message
...
Well, ok good,.........yours counts bob/bob/bob as 3 alright, but that
case-sensitivity stuff drives me nuts...........
when you get "older", you'll see............<g

Vaya con Dios,
Chuck, CABGx3




"RagDyer" wrote in message
...
Just responded to a similar question in the excel group where the OP

had
*multiple* names in a cell.

A2 to A100 contains name data.
Enter name 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!
--
Regards,

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


"CLR" wrote in message
...
Very nice Dave.........I love that one but can never remember it
<g...........by the way, did you see that it only counts

bob/bob/bob
as
just one "bob"? .......of course I doubt the OP will experience

that
combination, but just a curiosity.....it's apparently counting cells

that
it
finds a bob in rather than the bob's themselves...........

Vaya con Dios,
Chuck, CABGx3




"Dave Peterson" wrote in message
...
maybe

=countif(a1:a10,"*bob*")

But if Bob is embedded in another name, it'll get counted.

Jim/Nabob/ralph

(I couldn't think of another name!)

James wrote:

To make it easy, I am trying to count the number of times the

name
"Bob"
appears in a range of cells. Most of the time, "Bob" is the only

name
in
the
cell, so COUNTIF would work. However, sometimes there will be 2

names
in
the
same cell, like this: "Joe/Bob." What kind of formula can I use

to
count
the
number of times "Bob" appears in a range of cells, including the

times
there
are 2 names in the same cell? With the COUNTIF function, it is

only
counting
the number of times "Bob" appears alone in a cell within the

range
of
cells.

--

Dave Peterson










  #11   Report Post  
Dave Peterson
 
Posts: n/a
Default

But you could use something like:

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

So that case isn't a problem.



RagDyer wrote:

Just responded to a similar question in the excel group where the OP had
*multiple* names in a cell.

A2 to A100 contains name data.
Enter name 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!
--
Regards,

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

"CLR" wrote in message
...
Very nice Dave.........I love that one but can never remember it
<g...........by the way, did you see that it only counts bob/bob/bob as
just one "bob"? .......of course I doubt the OP will experience that
combination, but just a curiosity.....it's apparently counting cells that

it
finds a bob in rather than the bob's themselves...........

Vaya con Dios,
Chuck, CABGx3




"Dave Peterson" wrote in message
...
maybe

=countif(a1:a10,"*bob*")

But if Bob is embedded in another name, it'll get counted.

Jim/Nabob/ralph

(I couldn't think of another name!)

James wrote:

To make it easy, I am trying to count the number of times the name

"Bob"
appears in a range of cells. Most of the time, "Bob" is the only name

in
the
cell, so COUNTIF would work. However, sometimes there will be 2 names

in
the
same cell, like this: "Joe/Bob." What kind of formula can I use to

count
the
number of times "Bob" appears in a range of cells, including the times

there
are 2 names in the same cell? With the COUNTIF function, it is only

counting
the number of times "Bob" appears alone in a cell within the range of

cells.

--

Dave Peterson




--

Dave Peterson
  #12   Report Post  
RagDyeR
 
Posts: n/a
Default

I like that.
Good idea!

Plus, it prevents Chuck from becoming "nuts".<g
--

Regards,

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

"Dave Peterson" wrote in message
...
But you could use something like:

=SUMPRODUCT(LEN(A2:A100)-LEN(SUBSTITUTE(UPPER(A2:A100),UPPER(C1),"")))/LEN(C
1)

So that case isn't a problem.



RagDyer wrote:

Just responded to a similar question in the excel group where the OP had
*multiple* names in a cell.

A2 to A100 contains name data.
Enter name 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!
--
Regards,

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

"CLR" wrote in message
...
Very nice Dave.........I love that one but can never remember it
<g...........by the way, did you see that it only counts bob/bob/bob as
just one "bob"? .......of course I doubt the OP will experience that
combination, but just a curiosity.....it's apparently counting cells

that
it
finds a bob in rather than the bob's themselves...........

Vaya con Dios,
Chuck, CABGx3




"Dave Peterson" wrote in message
...
maybe

=countif(a1:a10,"*bob*")

But if Bob is embedded in another name, it'll get counted.

Jim/Nabob/ralph

(I couldn't think of another name!)

James wrote:

To make it easy, I am trying to count the number of times the name

"Bob"
appears in a range of cells. Most of the time, "Bob" is the only

name
in
the
cell, so COUNTIF would work. However, sometimes there will be 2

names
in
the
same cell, like this: "Joe/Bob." What kind of formula can I use to

count
the
number of times "Bob" appears in a range of cells, including the

times
there
are 2 names in the same cell? With the COUNTIF function, it is only

counting
the number of times "Bob" appears alone in a cell within the range

of
cells.

--

Dave Peterson




--

Dave Peterson


  #13   Report Post  
RagDyeR
 
Posts: n/a
Default

BUT, now have to add to the caveat:

It *also* counts "alfred" & "wilfred"<g
--

Regards,

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

"RagDyeR" wrote in message
...
I like that.
Good idea!

Plus, it prevents Chuck from becoming "nuts".<g
--

Regards,

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

"Dave Peterson" wrote in message
...
But you could use something like:

=SUMPRODUCT(LEN(A2:A100)-LEN(SUBSTITUTE(UPPER(A2:A100),UPPER(C1),"")))/LEN(C
1)

So that case isn't a problem.



RagDyer wrote:

Just responded to a similar question in the excel group where the OP had
*multiple* names in a cell.

A2 to A100 contains name data.
Enter name 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!
--
Regards,

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

"CLR" wrote in message
...
Very nice Dave.........I love that one but can never remember it
<g...........by the way, did you see that it only counts bob/bob/bob as
just one "bob"? .......of course I doubt the OP will experience that
combination, but just a curiosity.....it's apparently counting cells

that
it
finds a bob in rather than the bob's themselves...........

Vaya con Dios,
Chuck, CABGx3




"Dave Peterson" wrote in message
...
maybe

=countif(a1:a10,"*bob*")

But if Bob is embedded in another name, it'll get counted.

Jim/Nabob/ralph

(I couldn't think of another name!)

James wrote:

To make it easy, I am trying to count the number of times the name

"Bob"
appears in a range of cells. Most of the time, "Bob" is the only

name
in
the
cell, so COUNTIF would work. However, sometimes there will be 2

names
in
the
same cell, like this: "Joe/Bob." What kind of formula can I use to

count
the
number of times "Bob" appears in a range of cells, including the

times
there
are 2 names in the same cell? With the COUNTIF function, it is only

counting
the number of times "Bob" appears alone in a cell within the range

of
cells.

--

Dave Peterson




--

Dave Peterson



  #14   Report Post  
Dave Peterson
 
Posts: n/a
Default

If the data is nice (separated by commas--no spaces), you could use:

=SUMPRODUCT(LEN(A2:A10)+2-
LEN(SUBSTITUTE(","&UPPER(A2:A10)&",",","&UPPER(C1) &",","")))/(LEN(C1)+2)

(all one cell)

The formula essentially adds a leading and trailing comma to each cell in the
range to count. And it adds the same leading and trailing commas in C1.

So now the formula looks for ",fred,".

You could remove extra spaces with =substitute(a1," ","").

And include that in the formula, too. But for me, I'd insert some extra columns
to do the clean up work. I find breaking it into smaller pieces that I can stop
and verify makes it easier than those giant formulas.



RagDyeR wrote:

BUT, now have to add to the caveat:

It *also* counts "alfred" & "wilfred"<g
--

Regards,

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

"RagDyeR" wrote in message
...
I like that.
Good idea!

Plus, it prevents Chuck from becoming "nuts".<g
--

Regards,

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

"Dave Peterson" wrote in message
...
But you could use something like:

=SUMPRODUCT(LEN(A2:A100)-LEN(SUBSTITUTE(UPPER(A2:A100),UPPER(C1),"")))/LEN(C
1)

So that case isn't a problem.

RagDyer wrote:

Just responded to a similar question in the excel group where the OP had
*multiple* names in a cell.

A2 to A100 contains name data.
Enter name 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!
--
Regards,

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

"CLR" wrote in message
...
Very nice Dave.........I love that one but can never remember it
<g...........by the way, did you see that it only counts bob/bob/bob as
just one "bob"? .......of course I doubt the OP will experience that
combination, but just a curiosity.....it's apparently counting cells

that
it
finds a bob in rather than the bob's themselves...........

Vaya con Dios,
Chuck, CABGx3




"Dave Peterson" wrote in message
...
maybe

=countif(a1:a10,"*bob*")

But if Bob is embedded in another name, it'll get counted.

Jim/Nabob/ralph

(I couldn't think of another name!)

James wrote:

To make it easy, I am trying to count the number of times the name

"Bob"
appears in a range of cells. Most of the time, "Bob" is the only

name
in
the
cell, so COUNTIF would work. However, sometimes there will be 2

names
in
the
same cell, like this: "Joe/Bob." What kind of formula can I use to

count
the
number of times "Bob" appears in a range of cells, including the

times
there
are 2 names in the same cell? With the COUNTIF function, it is only
counting
the number of times "Bob" appears alone in a cell within the range

of
cells.

--

Dave Peterson



--

Dave Peterson


--

Dave Peterson
  #15   Report Post  
CLR
 
Posts: n/a
Default

Yup, yup........life is good..............nice one Dave.........

Vaya con Dios,
Chuck, CABGx3



"RagDyeR" wrote in message
...
I like that.
Good idea!

Plus, it prevents Chuck from becoming "nuts".<g
--

Regards,

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

"Dave Peterson" wrote in message
...
But you could use something like:


=SUMPRODUCT(LEN(A2:A100)-LEN(SUBSTITUTE(UPPER(A2:A100),UPPER(C1),"")))/LEN(C
1)

So that case isn't a problem.



RagDyer wrote:

Just responded to a similar question in the excel group where the OP had
*multiple* names in a cell.

A2 to A100 contains name data.
Enter name 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!
--
Regards,

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

"CLR" wrote in message
...
Very nice Dave.........I love that one but can never remember it
<g...........by the way, did you see that it only counts bob/bob/bob

as
just one "bob"? .......of course I doubt the OP will experience that
combination, but just a curiosity.....it's apparently counting cells

that
it
finds a bob in rather than the bob's themselves...........

Vaya con Dios,
Chuck, CABGx3




"Dave Peterson" wrote in message
...
maybe

=countif(a1:a10,"*bob*")

But if Bob is embedded in another name, it'll get counted.

Jim/Nabob/ralph

(I couldn't think of another name!)

James wrote:

To make it easy, I am trying to count the number of times the name

"Bob"
appears in a range of cells. Most of the time, "Bob" is the only

name
in
the
cell, so COUNTIF would work. However, sometimes there will be 2

names
in
the
same cell, like this: "Joe/Bob." What kind of formula can I use to

count
the
number of times "Bob" appears in a range of cells, including the

times
there
are 2 names in the same cell? With the COUNTIF function, it is

only
counting
the number of times "Bob" appears alone in a cell within the range

of
cells.

--

Dave Peterson



--

Dave Peterson




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
CountIf first column range = "Word" and second column range <> 0 TinaMo Excel Worksheet Functions 3 June 3rd 05 10:56 PM
Can Excel Export Data to Word Format? Reddiance Excel Discussion (Misc queries) 2 April 18th 05 06:03 PM
How to embed Word document into Excel and retain sizing, formatti. Kent Excel Discussion (Misc queries) 0 February 2nd 05 07:37 PM
Embedded word doc changed to image-need to change back to word. cflores Excel Discussion (Misc queries) 0 January 23rd 05 06:45 AM
COUNTIF text where there is more than one word in a cell Abi Excel Worksheet Functions 2 January 20th 05 03:32 AM


All times are GMT +1. The time now is 08:39 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"