seeking a formula to count occurrences of a character

R

Ron

Hello,

Can anyone tell me if I can create a formula to count the
number of commas in a character string? For example, if a
cell contains the string "10,2,9,5" then I would like to
formula to return 3 which is the number of commas in the
string.

Thanks
Ron
 
B

Bob Phillips

=len(A1)-len(substitute(A1,",",""))

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Top