How to count the occurences of a text string within a cell...

  • Thread starter Thread starter Healingbear
  • Start date Start date
H

Healingbear

I'm trying to count the number of text-strings, in this case commas,
within a cell.

For instance:

A1(text)=AB,BC,CD,DE,EF

If I could count 4 commas, I'd know there were (4)+1 objects in the
cell...

Thanks in advance. I always research as much as possible before asking
the forum. The forum has ALWAYS come through with the answer!
 
Something like:

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

or more generic:

=LEN(A1)-LEN(SUBSTITUTE(UPPER(A1),"SOMETEXTHERE",""))/LEN("SOMETEXTHERE")
 
Back
Top