View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom Peo Sjoblom is offline
external usenet poster
 
Posts: 3,268
Default Count characters within a string

Try

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

do the same for the other characters


--
Regards,

Peo Sjoblom


"Francisco" wrote in message
...
I would like to count how many "1", "x" and "2" I have within the string
below:
cell a1, string "1x21x21x21x21xx",
cell b1, 5 ( number of "1")
cell c1, 6 ( number of "x")
cell d1, 4 ( number of "2")

Bear in mind that string could change in size, with more or less
characters
on it and column A is full of them, around 5000 rows.
Is there any formula or combination of formulas that allow me to calcualte
this?
Thanks in advance.