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

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
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,223,907
Messages
6,175,300
Members
452,633
Latest member
DougMo

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