Count occurrence of character within a cell

G

Guest

I would like to count the number of a particular character within a cell. In
the cell are store numbers/names separated by the | character. The store
number/name represents a stop that the truck made. There is always one more
| character than stops. An example is: PER | R7 | PER is one stop at R7.
Another example is: BAK | 80 | 42 | BAK is 2 stops- one at 80 and one at 42.
Yes there is a space before and after the | character and PER or BAK is where
the truck started and ended. Thank you for any help.
 
B

Bernard Liengme

Not sure from message what to count.
This =LEN(A2)-LEN(SUBSTITUTE(A2,"|","")) counts number of | charters in A2's
value
So =LEN(A2)-LEN(SUBSTITUTE(A2,"|","")) -1 counts stops?
best wishes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top