close

I am trying to count the number of times a particular phrase appears in
a cell.

example: quot;#Callquot; is what I want to count.

however all the cells are formatted like #Callme-name,

Can any one help...--
kelljeff
------------------------------------------------------------------------
kelljeff's Profile: www.excelforum.com/member.php...oamp;userid=32007
View this thread: www.excelforum.com/showthread...hreadid=525671Try...

=COUNTIF(A2:A100,quot;#Call*quot;)

or

=COUNTIF(A2:A100,B2amp;quot;*quot;)

....where B2 contains your criteria, such as '#Call'.

Hope this helps!

In article gt;,
kelljeff gt; wrote:

gt; I am trying to count the number of times a particular phrase appears in
gt; a cell.
gt;
gt; example: quot;#Callquot; is what I want to count.
gt;
gt; however all the cells are formatted like #Callme-name,
gt;
gt; Can any one help...


The First worked... Thank you.

Just out of curiosity, I tried that minus the quot;*quot; and it did not work.
Does the quot;*quot; do something special ?

Again Thank you...--
kelljeff
------------------------------------------------------------------------
kelljeff's Profile: www.excelforum.com/member.php...oamp;userid=32007
View this thread: www.excelforum.com/showthread...hreadid=525671The quot;*quot; is a wildcard character. So basically any cell where the first
5 characters are '#Call' gets counted. If you change the formula to...

=COUNTIF(A2:A100,quot;*#Call*quot;)

....a cell gets counted when quot;#Callquot; occurs anywhere in the string. For
example, cells containing the following strings all get counted...

#Call

#Callxxxxx

xxxx#Call

xxxx#Callxxxx

Hope this helps!

In article gt;,
kelljeff gt;
wrote:

gt; The First worked... Thank you.
gt;
gt; Just out of curiosity, I tried that minus the quot;*quot; and it did not work.
gt; Does the quot;*quot; do something special ?
gt;
gt; Again Thank you...

I used part of this and it got me thinking of how could I count how many
times a character is appears within a CELL. I would like to count the
backward slash character quot;\quot;. If cell A2 contains quot;w:\jason\hopson\file.xlsquot;
the number would be 3. Any advise?

quot;Domenicquot; wrote:

gt; The quot;*quot; is a wildcard character. So basically any cell where the first
gt; 5 characters are '#Call' gets counted. If you change the formula to...
gt;
gt; =COUNTIF(A2:A100,quot;*#Call*quot;)
gt;
gt; ....a cell gets counted when quot;#Callquot; occurs anywhere in the string. For
gt; example, cells containing the following strings all get counted...
gt;
gt; #Call
gt;
gt; #Callxxxxx
gt;
gt; xxxx#Call
gt;
gt; xxxx#Callxxxx
gt;
gt; Hope this helps!
gt;
gt; In article gt;,
gt; kelljeff gt;
gt; wrote:
gt;
gt; gt; The First worked... Thank you.
gt; gt;
gt; gt; Just out of curiosity, I tried that minus the quot;*quot; and it did not work.
gt; gt; Does the quot;*quot; do something special ?
gt; gt;
gt; gt; Again Thank you...
gt;

Try...

=LEN(A2)-LEN(SUBSTITUTE(A2,quot;\quot;,quot;quot;))

Hope this helps!

In article gt;,
Rookie_User gt; wrote:

gt; I used part of this and it got me thinking of how could I count how many
gt; times a character is appears within a CELL. I would like to count the
gt; backward slash character quot;\quot;. If cell A2 contains quot;w:\jason\hopson\file.xlsquot;
gt; the number would be 3. Any advise?

Domenic,
It worked perfectly - thank you so much. I just wanted to post a
success/closure. However, if you have time, could you better explain why it
works?

quot;Domenicquot; wrote:

gt; Try...
gt;
gt; =LEN(A2)-LEN(SUBSTITUTE(A2,quot;\quot;,quot;quot;))
gt;
gt; Hope this helps!
gt;
gt; In article gt;,
gt; Rookie_User gt; wrote:
gt;
gt; gt; I used part of this and it got me thinking of how could I count how many
gt; gt; times a character is appears within a CELL. I would like to count the
gt; gt; backward slash character quot;\quot;. If cell A2 contains quot;w:\jason\hopson\file.xlsquot;
gt; gt; the number would be 3. Any advise?
gt;

Lets say there are 12 characters in A2 where of 2 are \

LEN(A2)

will count all characters in A2,

now you substitute the 2 \ with 2 quot;quot; meaning that the total count would go
from 12 to 10 (quot;quot; is counted as empty using LEN)

thus

LEN(SUBSTITUTE(A2,quot;\quot;,quot;quot;))

first substitute then count will give 10 then finally subtract that from the
total count gives

=12-10

gives 2 \--

Regards,

Peo Sjoblom

nwexcelsolutions.com
quot;Rookie_Userquot; gt; wrote in message
...
gt; Domenic,
gt; It worked perfectly - thank you so much. I just wanted to post a
gt; success/closure. However, if you have time, could you better explain why
gt; it
gt; works?
gt;
gt; quot;Domenicquot; wrote:
gt;
gt;gt; Try...
gt;gt;
gt;gt; =LEN(A2)-LEN(SUBSTITUTE(A2,quot;\quot;,quot;quot;))
gt;gt;
gt;gt; Hope this helps!
gt;gt;
gt;gt; In article gt;,
gt;gt; Rookie_User gt; wrote:
gt;gt;
gt;gt; gt; I used part of this and it got me thinking of how could I count how
gt;gt; gt; many
gt;gt; gt; times a character is appears within a CELL. I would like to count the
gt;gt; gt; backward slash character quot;\quot;. If cell A2 contains
gt;gt; gt; quot;w:\jason\hopson\file.xlsquot;
gt;gt; gt; the number would be 3. Any advise?
gt;gt;

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()