PC Review


Reply
Thread Tools Rate Thread

CountIf query within text 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
 
 
 
 
Alan Moseley
Guest
Posts: n/a
 
      20th Oct 2008
John

The folmula you need is:-
=COUNTIF(range,"=" & A1)

Regards.
--
Alan Moseley IT Consultancy
http://www.amitc.co.uk


"JohnH" wrote:

> 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
CountIf query for words within string JohnH Microsoft Excel Programming 1 20th Oct 2008 10:57 AM
COUNTIF according to presence of string within text Ingeniero1 Microsoft Excel Worksheet Functions 5 1st Feb 2006 06:43 PM
Countif function for instances of text string contained =?Utf-8?B?R2FyYnVua2Vs?= Microsoft Excel Worksheet Functions 1 11th Oct 2005 08:09 AM
RE: Countif function for instances of text string contained =?Utf-8?B?RGF2aWQgQmlsbGlnbWVpZXI=?= Microsoft Excel Worksheet Functions 2 10th Oct 2005 09:51 PM
Re: countif text-string in one cell is part of text in array Bernie Deitrick Microsoft Excel Worksheet Functions 0 9th Sep 2004 04:02 PM


Features
 

Advertising
 

Newsgroups
 


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