ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   searching for multiple text strings (https://www.excelbanter.com/excel-discussion-misc-queries/21166-searching-multiple-text-strings.html)

eddie

searching for multiple text strings
 
How do you search for multiple words in any given cell. The order of the
words being searched does not matter.

i.e. If I am looking for the words 'brake' and 'clutch':

1 "John's Brake and Clutch"
2 "Jerry's Clutch Repair"
3 "Impact Clutch/Brake"
4 "Brakes and Clutches r Us"

If want the search to work for 1, 3, and 4. Any ideas?

N Harkawat

Use this formula assuming that the text is on cell A1
=--ISNUMBER(SEARCH("clutch",A1))+(--ISNUMBER(SEARCH("brake",a1)))
all values = 2 is your answer



"eddie" wrote in message
...
How do you search for multiple words in any given cell. The order of the
words being searched does not matter.

i.e. If I am looking for the words 'brake' and 'clutch':

1 "John's Brake and Clutch"
2 "Jerry's Clutch Repair"
3 "Impact Clutch/Brake"
4 "Brakes and Clutches r Us"

If want the search to work for 1, 3, and 4. Any ideas?




Jason Morin

With entries in col. A, you could tag the entries in
column B using:

=IF(SUM(COUNTIF(A1,{"*brake*","*clutch*"}))=2,"b/c","")

HTH
Jason
Atlanta, GA

-----Original Message-----
How do you search for multiple words in any given

cell. The order of the
words being searched does not matter.

i.e. If I am looking for the words 'brake' and 'clutch':

1 "John's Brake and Clutch"
2 "Jerry's Clutch Repair"
3 "Impact Clutch/Brake"
4 "Brakes and Clutches r Us"

If want the search to work for 1, 3, and 4. Any ideas?
.


eddie

I appreciate your help. Problem solved.

"N Harkawat" wrote:

Use this formula assuming that the text is on cell A1
=--ISNUMBER(SEARCH("clutch",A1))+(--ISNUMBER(SEARCH("brake",a1)))
all values = 2 is your answer



"eddie" wrote in message
...
How do you search for multiple words in any given cell. The order of the
words being searched does not matter.

i.e. If I am looking for the words 'brake' and 'clutch':

1 "John's Brake and Clutch"
2 "Jerry's Clutch Repair"
3 "Impact Clutch/Brake"
4 "Brakes and Clutches r Us"

If want the search to work for 1, 3, and 4. Any ideas?





eddie

Thanks for the help. Works perfectly.

"Jason Morin" wrote:

With entries in col. A, you could tag the entries in
column B using:

=IF(SUM(COUNTIF(A1,{"*brake*","*clutch*"}))=2,"b/c","")

HTH
Jason
Atlanta, GA

-----Original Message-----
How do you search for multiple words in any given

cell. The order of the
words being searched does not matter.

i.e. If I am looking for the words 'brake' and 'clutch':

1 "John's Brake and Clutch"
2 "Jerry's Clutch Repair"
3 "Impact Clutch/Brake"
4 "Brakes and Clutches r Us"

If want the search to work for 1, 3, and 4. Any ideas?
.




All times are GMT +1. The time now is 08:11 PM.

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