Multiple Criteria lookup and return text

jmewebb

New Member
Joined
Dec 6, 2012
Messages
43
Office Version
  1. 365
Platform
  1. Windows
[TABLE="width: 500"]
<tbody>[TR]
[TD]Current Text (A)[/TD]
[TD]Desired Lookup Result (B)[/TD]
[/TR]
[TR]
[TD]green apple[/TD]
[TD]apple[/TD]
[/TR]
[TR]
[TD]red apple[/TD]
[TD]apple[/TD]
[/TR]
[TR]
[TD]brown banana[/TD]
[TD]banana[/TD]
[/TR]
[TR]
[TD]yellow banana[/TD]
[TD]banana[/TD]
[/TR]
[TR]
[TD]yellow strawberry[/TD]
[TD]strawberry[/TD]
[/TR]
[TR]
[TD]red strawberry[/TD]
[TD]strawberry[/TD]
[/TR]
</tbody>[/TABLE]

Column A contains extended text with the key word. I want to return the key word in column B. I have three keys words I am searching for in the data.
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
For an entry in cell A2 (formula to put in cell B2 and copy down):
Code:
=IF(ISNUMBER(SEARCH("apple",A2)),"apple",IF(ISNUMBER(SEARCH("banana",A2)),"banana",IF(ISNUMBER(SEARCH("strawberry",A2)),"strawberry","")))
 
Upvote 0
Another way.

You can try this too:

=IFERROR(LOOKUP(1,1/SEARCH(" "&$D$2:$D$4&" "," "&A2&" "),$D$2:$D$4),"")

[TABLE="class: grid, width: 390"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Current Text (A)[/TD]
[TD]Desired Lookup Result (B)[/TD]
[TD][/TD]
[TD]List[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]green apple[/TD]
[TD]apple[/TD]
[TD][/TD]
[TD]apple[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]red apple[/TD]
[TD]apple[/TD]
[TD][/TD]
[TD]banana[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]brown banana[/TD]
[TD]banana[/TD]
[TD][/TD]
[TD]strawberry[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]yellow banana[/TD]
[TD]banana[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]yellow strawberry[/TD]
[TD]strawberry[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]red strawberry[/TD]
[TD]strawberry[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]****[/TD]
[TD]******************[/TD]
[TD]**************************[/TD]
[TD]****[/TD]
[TD]*************[/TD]
[TD]****[/TD]
[/TR]
</tbody>[/TABLE]

Markmzz
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,184
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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