View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default How to count the number of occurrence within string?

Try this in C1...

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

--
Rick (MVP - Excel)


"Eric" wrote in message
...
Does anyone have any suggestions on how to count the number of occurrence
within string? For example, aa11bb5c in cell A1, and "a" in cell B1, I
would
like to count the number of occurrence for the char "a" in cell B1 within
string "aa11bb5c" in cell A1, and return the number of occurrence 2 in
cell
c1.
Does anyone have any suggestions?
Thanks in advance for any suggestions
Eric