If cell b1,b2 or b3 is contained in cell a1, then enter the word that is contained in cell a1

jeremypyle

Board Regular
Joined
May 30, 2011
Messages
174
If I had 2 lists. List 1 was in column A and list 2 was column B :

A1) bigtomato
A2) fatamerican
A3) happysailer

B1) round
B2) hat
B3) big

And I want to have a code that says if A1 contains (B1,B2 or B3) then enter that contained word. In this case A1 contains the word "big" from B3

How would I code this:

I have tried created the following code in C1
=IF(OR((ISNUMBER(SEARCH($B1,$A1))),(ISNUMBER(SEARCH($B2,$A1))),(ISNUMBER(SEARCH($B3,$A1)))),$B1,"")

This code only works if the word "big" was in cell one

The code somehow needs to say if A1 contains B1,B2 or B3 then enter b1,b2 or b3 (depending on which word was contained)

If you can figure this out, you are a GENIUS!!!
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

Forum statistics

Threads
1,223,983
Messages
6,175,777
Members
452,668
Latest member
mrider123

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