Formula to count characters with criteria

I

ian salmon

I am trying to count the number of charcters in a cell
that satisfy certaijn criteria.
e.g. If cell A1 contains the following then how many 1's
exist in the cell <1111011111110011>

The answer should be 13.

Thanks in advance for any help.

ian
 
A

Aladin Akyurek

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

where I assume that A1 is formatted as text then 1111011111110011 is entered
in A1.
 
R

Ron Rosenfeld

I am trying to count the number of charcters in a cell
that satisfy certaijn criteria.
e.g. If cell A1 contains the following then how many 1's
exist in the cell <1111011111110011>

The answer should be 13.

Thanks in advance for any help.

ian

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


--ron
 

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