counting characters within a cell

R

Rowland Long

Is there a way to count the occurrences of a certain character within a
cell?

For instance cell A1 contains 1-20/2-12/3-9
I need to find how many times '-' or '/' occurs in A1

thanks in advance,
Rowland
 
H

Harald Staff

Hi Rowland

The usual way is to compare the length of the text to the length of the text
where the character is removed. The difference equals the count of removed
characters.

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

HTH. Best wishes Harald
 

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