View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default Count the number of appearance within a cell

Try this:

=LEN(A1)-LEN(SUBSTITUTE(UPPER(A1),"P",""))

Note that SUBSTITUTE is case sensitive. So, enter the character you want to
count in upper case. Or, you can enter the character in a cell then refer to
that cell:

B1 = P or p

Then:

=LEN(A1)-LEN(SUBSTITUTE(UPPER(A1),UPPER(B1),""))


--
Biff
Microsoft Excel MVP


"Lucy" wrote in message
...
In cell A1, I put text "Apple"

How can I count the number of appearance of letter "p" within one cell?

I would like the answer come out as numeric "2"

Thanks.