Search cell text and then display text for multiple possibilities ??

XLS888

New Member
Joined
Sep 30, 2017
Messages
9
Hi,

In B1 I have the following formula to search A1. Similarly, B2 to search A2, etc.

=IF(ISNUMBER(SEARCH("COSTCO",A1)), "Supermarket","")

However, I need to have multiple criteria all within the above formula. For example:

IF "COSTCO" then display "Supermarket"
IF "TESCO" then display "Supermarket"
IF "LLOYDS" then display "Bank"
IF "BARCLAYS" then display "Bank"
IF "VODAFONE" then display "Mobile"
... etc for about 20 items.


And if none of the above, then display nothing. Presumably ""


Secondly, feel free to say if there if there is a better way (though shorter formulae preferred) to achieve this other than
=IF(ISNUMBER(SEARCH


Thanks!
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Would this work for you?
I have made a lookup table in columns E:F. Those columns could be hidden or placed on another worksheet.
Formula in B2 is copied down after adjusting ranges to suit your full list.

Excel Workbook
ABCDEF
1
2Delivered to CostcoSupermarketCOSTCOSupermarket
3Barclays in High StreetBankTESCOSupermarket
4LLOYDSBank
5That is a red carBARCLAYSBank
6Which Tesco dod you go to?SupermarketVODAFONEMobile
7Vodafone LondonMobile
XLS888
 
Upvote 0
Brilliant, thanks.

On reflection it is easier to have a separate table rather trying to make a very long formula. Cheers
 
Upvote 0
Brilliant, thanks.

On reflection it is easier to have a separate table rather trying to make a very long formula. Cheers
You're welcome. Yes, it would be a very long formula without a table if you have 20+ options! :eek:
 
Upvote 0

Forum statistics

Threads
1,216,730
Messages
6,132,399
Members
449,725
Latest member
Enero1

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