PC Review


Reply
Thread Tools Rate Thread

Counting cells that contain a substring

 
 
John
Guest
Posts: n/a
 
      22nd Feb 2009
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
 
Reply With Quote
 
 
 
 
Lars-Åke Aspelin
Guest
Posts: n/a
 
      22nd Feb 2009
On Sun, 22 Feb 2009 03:07:01 -0800, John
<(E-Mail Removed)> wrote:

>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
 
Reply With Quote
 
Shane Devenshire
Guest
Posts: n/a
 
      22nd Feb 2009
Hi,

You are almost there:

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

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

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"John" wrote:

> 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

 
Reply With Quote
 
T. Valko
Guest
Posts: n/a
 
      22nd Feb 2009
Put the substring in a cell:

A1 = kkkk

then:

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

--
Biff
Microsoft Excel MVP


"John" <(E-Mail Removed)> wrote in message
news:6EDA0FED-5E02-4AED-AFC0-(E-Mail Removed)...
> 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



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count the number of cells in a range with a string containing a specified substring Sisilla Microsoft Excel Programming 1 19th Mar 2007 12:30 PM
Count the number of cells in a range with a string containing a specified substring Sisilla Microsoft Excel Programming 2 19th Mar 2007 12:01 PM
regular expression to match substring xxx and not substring yyy likong@email.com Microsoft C# .NET 6 9th Dec 2005 06:30 PM
Counting occurences of a substring in a range of cells. Jeff Cantwell Microsoft Excel Worksheet Functions 4 8th Sep 2005 10:45 PM
counting occurences of a substring Peter Microsoft Excel Worksheet Functions 1 25th Jun 2003 06:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:06 PM.