counting how many times a given letter appears in a tekst string in a cell

E

Erik

Is there a function in Excel which may be used for counting the number of
instances of a given letter in a cell (containing a text)?



E.g if I am counting "c" in cell B2 which has the text string"Kentucky Fried
Chicken", the result should be 3

Thank you

Ealadi
 
A

Aladin Akyurek

=LEN(B2)-LEN(SUBSTITUTE(UPPER(B2),UPPER(C2),""))

where B2 houses a target string like "Kentucky Fried Chicken" and C2 a
single char like "c" or "C".
 
B

Biff

Hi Ealadi!

Here's one way:

Use a cell reference to hold the letter that you want to
count. For example cell B2 = Kentucky Fried Chicken. In
cell C2 enter c or C. In cell D2 enter this formula:

=LEN(B2)-LEN(SUBSTITUTE(SUBSTITUTE(B2,LOWER(C2),""),UPPER
(C2),""))

Biff
 
E

Erik

Hello Aladin and Biff

Thank you for your solutions. They work perfect, but having applied them in
my Danish edition of Office 2003 by translating each term, I have one more
question:

Is there a way og making Excel understand formulas written in another
language?
Thank you
Ealadi
 
F

Frank Kabel

Hi
not possible.
-----Original Message-----
Hello Aladin and Biff

Thank you for your solutions. They work perfect, but having applied them in
my Danish edition of Office 2003 by translating each term, I have one more
question:

Is there a way og making Excel understand formulas written in another
language?
Thank you
Ealadi





"Erik" <[email protected]> skrev i en meddelelse string"Kentucky


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top