Search for multiple text

currybai

Board Regular
Joined
Jul 14, 2008
Messages
202
Hi,

I have in column A, a bunch of store names.

For example:

Target-Macys-BestBuy-Kohls.


How can I search for text within that cell if I just want Target and Macys, but not Kohls and then the return value would be something like true or false.

Thanks
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
How about?

=IF(ISNUMBER(SUM(SEARCH({"Target","Macys"},A1))),IF(ISERROR(SEARCH("Kohls",A1)),TRUE))


Thanks for the quick reply.

Everything returns a false.

I have it as

=IF(ISNUMBER(SUM(SEARCH({"Target","Macys"},A1))),IF(ISERROR(SEARCH("Kohls","Bloomingdales",A1)),TRUE))
 
Upvote 0
What's Bloomingdales doing in there? That's moving the goalposts.

=IF(ISNUMBER(SUM(SEARCH({"Target","Macys"},A1))),IF(ISERROR(SEARCH("Kohls",A1)),IF(ISERROR(SEARCH("Bloomingdales",A1)),TRUE)))
 
Upvote 0
What's Bloomingdales doing in there? That's moving the goalposts.

=IF(ISNUMBER(SUM(SEARCH({"Target","Macys"},A1))),IF(ISERROR(SEARCH("Kohls",A1)),IF(ISERROR(SEARCH("Bloomingdales",A1)),TRUE)))


It is still returning all false. I should have been more clear, but if A1 has macys or target or whatever else.
 
Upvote 0
Please post some sample data and the results you expect.


A1

<table width="584" border="0" cellpadding="0" cellspacing="0"><col width="584"><tr height="20"> <td style="height: 15pt; width: 438pt;" width="584" height="20">Macys-Target-Kohls-BestBuy-HomeDepot-bloomingdales
</td> </tr></table>

If A1 has macys or target or bestbuy but not kohls or bloomingdales then show True.
 
Upvote 0
First it's target and macys, now it's macys or target or bestbuy. Try:

=IF(SUM(--ISNUMBER(SEARCH({"macys","target","bestbuy"},A1))),IF(NOT(SUM(--ISNUMBER(SEARCH({"kohls","bloomingdales"},A1)))),TRUE))
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,740
Members
452,940
Latest member
Lawrenceiow

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top