PC Review


Reply
Thread Tools Rate Thread

COUNTIF formula?

 
 
F J
Guest
Posts: n/a
 
      17th May 2011
Hi, I’m using Excel 2002 and I have a question about using a formula
to determine if certain words are found within a cell. For example, I
want to determine if several words are found in each cell in column A
and, if so, I want to put the word “Yes” in the corresponding cell in
column B. If the word isn’t found then I just want that cell in
column B to remain blank. So, in the following example, I want to see
if the following words:

Oranges
Apples
Lemons

are found in any of the cells in column A. The result would look like
this:

Column A Column B
Apples, Oranges, Pears Yes
Apples, Oranges Yes
Apples Yes
Limes, Pears
Oranges Yes
Pears
Oranges, Lemons, Limes Yes
Lemons, Limes Yes
Limes
Apples, Limes Yes

I know I could use a formula like this:

=IF(OR(COUNTIF(A1,"*Oranges*"),COUNTIF(A1,"*Apples*"),COUNTIF(A1,"*Lemons*")),"Yes","")

to do this in this example, but the real spreadsheets I am working
with sometimes have 50 or more words to look up in thousands of rows.
Is there any way to do this using a combination of COUNTIF and VLOOKUP
or MATCH or something like that? So far my attempts to do so have
failed. Thanks in advance for any information.
 
Reply With Quote
 
 
 
 
F J
Guest
Posts: n/a
 
      17th May 2011
Hi, Ron, thank you for your response. I tried your formula worked
great. This will save me so much time and work.

Thanks again!



On May 17, 6:30*am, Ron Rosenfeld <r...@nospam.net> wrote:
> On Mon, 16 May 2011 23:29:15 -0700 (PDT), F J <fjg...@gmail.com> wrote:
> >Hi, I’m using Excel 2002 and I have a question about using a formula
> >to determine if certain words are found within a cell. *For example, I
> >want to determine if several words are found in each cell in column A
> >and, if so, I want to put the word “Yes” in the corresponding cell in
> >column B. *If the word isn’t found then I just want that cell in
> >column B to remain blank. *So, in the following example, I want to see
> >if the following words:

>
> >Oranges
> >Apples
> >Lemons

>
> >are found in any of the cells in column A. *The result would look like
> >this:

>
> >Column A * * * * * * * * * * * * * * * ** *Column B
> >Apples, Oranges, Pears * * * * * * *Yes
> >Apples, Oranges * * * * * * * * * * Yes
> >Apples * * * * * * * * * * * * * * * * * * *Yes
> >Limes, Pears
> >Oranges * * * * * * * * * * * * * * * * * * Yes
> >Pears
> >Oranges, Lemons, Limes * * * * * * *Yes
> >Lemons, Limes * * * * * * * * * * * * * * * Yes
> >Limes
> >Apples, Limes * * * * * * * * * * * * * * * Yes

>
> >I know I could use a formula like this:

>
> >=IF(OR(COUNTIF(A1,"*Oranges*"),COUNTIF(A1,"*Apples*"),COUNTIF(A1,"*Lemons**")),"Yes","")

>
> >to do this in this example, but the real spreadsheets I am working
> >with sometimes have 50 or more words to look up in thousands of rows.
> >Is there any way to do this using a combination of COUNTIF and VLOOKUP
> >or MATCH or something like that? *So far my attempts to do so have
> >failed. *Thanks in advance for any information.

>
> Enter the words to look up in some range, one word per range.
>
> I NAME'd my range List_of_Fruits, but you can use absolute references also.
>
> Then try this formula which must be **array-entered**:
>
> =IF(OR(COUNTIF(A1,"*" & List_of_Fruits &"*")),"Yes","")
>
> ----------------------------------------
>
> To **array-enter** a formula, after entering
> the formula into the cell or formula bar, hold down
> <ctrl><shift> while hitting <enter>. *If you did this
> correctly, Excel will place braces {...} around the formula.- Hide quotedtext -
>
> - Show quoted text -


 
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 FORMULA ISSUES - NEED FORMULA CORRECTED Debbi Microsoft Excel Worksheet Functions 2 18th Nov 2009 04:47 AM
countif formula Paul E Microsoft Excel Worksheet Functions 4 5th Nov 2008 02:04 PM
And/Countif formula =?Utf-8?B?bmlyMDIw?= Microsoft Excel Programming 1 11th Jan 2006 04:12 PM
CountIf formula results in the formula itself being displayed. =?Utf-8?B?TmV3S2lk?= Microsoft Excel Worksheet Functions 9 21st Dec 2005 11:10 PM
Countif formula Daniel Bonallack Microsoft Excel Worksheet Functions 3 16th Oct 2003 03:32 PM


Features
 

Advertising
 

Newsgroups
 


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