PC Review


Reply
Thread Tools Rate Thread

Count If query within string

 
 
JohnH
Guest
Posts: n/a
 
      20th Oct 2008
Hi all,

I am trying to count a word within a range of cells. Some cells may contain
the word within a text string for example:
Count the word "red" within "red 1", "red 2", "red 3" etc.
I know this can be done with the formula..."=CountIf(range, "*red*")"

The real question is if this is possible to search by a cell value?
ie. If cell "A1" equals "red" then count "red", if "A1" equals "blue" then
count the number of times "blue" appears.

Hope this makes sense. Thank you.
 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      20th Oct 2008
=COUNTIF(range,"*"&A1&"*")

--
__________________________________
HTH

Bob

"JohnH" <(E-Mail Removed)> wrote in message
news:00B3512D-BEC9-41C1-BFF5-(E-Mail Removed)...
> Hi all,
>
> I am trying to count a word within a range of cells. Some cells may
> contain
> the word within a text string for example:
> Count the word "red" within "red 1", "red 2", "red 3" etc.
> I know this can be done with the formula..."=CountIf(range, "*red*")"
>
> The real question is if this is possible to search by a cell value?
> ie. If cell "A1" equals "red" then count "red", if "A1" equals "blue" then
> count the number of times "blue" appears.
>
> Hope this makes sense. Thank you.



 
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 a string withing a string - VBA BillGlad Microsoft Access VBA Modules 2 28th Nov 2009 08:41 PM
how to get count(col1), count(col2), count(sol3) with only one query Mario Krsnic Microsoft Access Queries 2 27th Oct 2006 06:52 PM
Count Instances Of String Within String Derek Hart Microsoft Dot NET 24 10th May 2006 07:52 PM
Tough One, trying to count occurences of string based on string in separate column Rick Microsoft Excel New Users 3 28th Feb 2004 02:10 AM
Tough One, trying to count occurences of string based on string in separate column Rick Microsoft Excel Worksheet Functions 3 28th Feb 2004 02:10 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:16 AM.