Counting cells that contain a substring

J

John

How do I count the number of cells in a range that contain the character
substring xxx?

I know =COUNTIF($G$8:$G$11,"kkkk") counts cells that are exactly kkkk, but i
want to count cells that congaing a substring.

I appreciate your help, -John
 
L

Lars-Åke Aspelin

How do I count the number of cells in a range that contain the character
substring xxx?

I know =COUNTIF($G$8:$G$11,"kkkk") counts cells that are exactly kkkk, but i
want to count cells that congaing a substring.

I appreciate your help, -John

Try this formula:

=SUMPRODUCT(--NOT(ISERROR(FIND("kkkk",G8:G11))))

If you don't care about lower and upper case, you can try this:

=SUMPRODUCT(--NOT(ISERROR(SEARCH("kkkk",G8:G11))))

Hope this helps / Lars-Åke
 
S

Shane Devenshire

Hi,

You are almost there:

=COUNTIF($G$8:$G$11,"*xxx*")

* is the wildcard for anything so this says anything containing xxx.
 

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