ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Search for more than one word (https://www.excelbanter.com/excel-worksheet-functions/32873-search-more-than-one-word.html)

GerryK

Search for more than one word
 
Could I please get some advice on how to make this formula (or some other
one) to look for more words?

=SEARCH("wires",A2:$AB$2000)

I'd like to conditionally format cells in AB that contain the words wires,
power, lines, cable.

TIA

David McRitchie

Hi Gerry,
You can use AND() if you want them all
You can use OR() if you want any of them

Search is not case sensitive, but you get an error if not found so this should get
you started, simply add the additional word. comparisons for "lines" and for "cable".

A1: corded wires
B1: =OR(NOT(ISERR(SEARCH("wires",A1,1))),NOT(ISERR(SEA RCH("power",A1,1))) )

Instead of using (or in addition to using) formula in B1, you could use the
same formula in Conditional Formatting.

For more information on Conditional Formatting see
http://www.mvps.org/dmcritchie/excel/condfmt.htm
For more information on strings see
http://www.mvps.org/dmcritchie/excel/strings.htm

Since you did, in fact, ask for Conditional Formatting....
Select column AB and with cell AB1 as the active cell, use the formula above
using AB1 instead of cell A1
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"GerryK" wrote in message ...
Could I please get some advice on how to make this formula (or some other
one) to look for more words?

=SEARCH("wires",A2:$AB$2000)

I'd like to conditionally format cells in AB that contain the words wires,
power, lines, cable.

TIA




bj

try
=or(not(iserror(find("wires",a2))),not(iserror(fin d("power",A2))), etc)
in your conditional fomat formula. If the case may be sensitive, you may
have to play with it somewhat.

"GerryK" wrote:

Could I please get some advice on how to make this formula (or some other
one) to look for more words?

=SEARCH("wires",A2:$AB$2000)

I'd like to conditionally format cells in AB that contain the words wires,
power, lines, cable.

TIA



All times are GMT +1. The time now is 03:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com