count no of times a letter occurs in a text string

N

nishad

I would like to count the no of times a specific letter occurs in a text
string.
For eg if "My name is Amit" is in cell A1. I want to count the no of times
"m" occurs in A1, which is '3'. Plz help.
 
S

Sandy Mann

Try:

=LEN(C6)-LEN(SUBSTITUTE(UPPER(C6),"M",""))

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

[email protected]
Replace @mailinator.com with @tiscali.co.uk
 
D

David Biddulph

Gives the answer 2 (not the 3 which the OP wanted) because SUBSTITUTE is
case-sensitive. You need a LOWER.
 
Top