Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / September 2007

Tip: Looking for answers? Try searching our database.

Can I use 'CONTAINS' in an IF Logical Test?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MichaelRobert - 20 Sep 2007 18:10 GMT
I want to use the IF function, but using a Logical Test on a given cell that
contains text, like 'Red; Green; Blue'. The cell may contain all, none, or
any of these words. If the cell contains Red, I want to Return Yes

My Function would look something like

=IF (Q2 CONTAINS "RED", "Yes", "No")

However, I only see IF working on numbers and not text.

Any ideas?

Thanks.

Mike
JE McGimpsey - 20 Sep 2007 18:15 GMT
One way:

   =IF(COUNTIF(Q2,"*RED*"),"Yes","No")

another:

   =IF(ISERR(SEARCH("RED",Q2)),"No","Yes")

> I want to use the IF function, but using a Logical Test on a given cell that
> contains text, like 'Red; Green; Blue'. The cell may contain all, none, or
[quoted text clipped - 11 lines]
>
> Mike
MichaelRobert - 20 Sep 2007 18:58 GMT
Works like a charm. Many thanks.

> One way:
>
[quoted text clipped - 19 lines]
> >
> > Mike
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.