search and extract the patterns

ananpani

New Member
Joined
May 6, 2018
Messages
4
Hi There,
can derive the output in multiple steps, but looking forward to find a formulae to do it one single step.. I tried using combinations of SEARCH,ISNUMBER functions, but did not get it right. So your help is highly appreciated.

[TABLE="width: 490"]
<colgroup><col span="2"><col></colgroup><tbody>[TR]
[TD]Text[/TD]
[TD]Desired Output[/TD]
[TD]Search values[/TD]
[/TR]
[TR]
[TD]Ten oranges have been sold[/TD]
[TD]oranges[/TD]
[TD]oranges[/TD]
[/TR]
[TR]
[TD]Yet to sell 15 potatos[/TD]
[TD]potato[/TD]
[TD]bananas[/TD]
[/TR]
[TR]
[TD]oranges shipped[/TD]
[TD]oranges[/TD]
[TD]grapes[/TD]
[/TR]
[TR]
[TD]potatos under inspection[/TD]
[TD]potatos[/TD]
[TD]potatas[/TD]
[/TR]
[TR]
[TD]grapes are sweet [/TD]
[TD]grapes[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]oranges to be picked up from farm[/TD]
[TD]oranges[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]oranges on the way to customer[/TD]
[TD]oranges[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]potatos are fresh from farm[/TD]
[TD]potatos[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]potatos saved lives[/TD]
[TD]potatos[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]potatos are the best of vegges[/TD]
[TD]potatos[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]oranges are the best of fruits[/TD]
[TD]oranges[/TD]
[TD] [/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Hi There,
can derive the output in multiple steps, but looking forward to find a formulae to do it one single step.. I tried using combinations of SEARCH,ISNUMBER functions, but did not get it right. So your help is highly appreciated.

[TABLE="width: 490"]
<tbody>[TR]
[TD]Text[/TD]
[TD]Desired Output[/TD]
[TD]Search values[/TD]
[/TR]
[TR]
[TD]Ten oranges have been sold[/TD]
[TD]oranges[/TD]
[TD]oranges[/TD]
[/TR]
[TR]
[TD]Yet to sell 15 potatos[/TD]
[TD]potato[/TD]
[TD]bananas[/TD]
[/TR]
[TR]
[TD]oranges shipped[/TD]
[TD]oranges[/TD]
[TD]grapes[/TD]
[/TR]
[TR]
[TD]potatos under inspection[/TD]
[TD]potatos[/TD]
[TD]potatas[/TD]
[/TR]
[TR]
[TD]grapes are sweet[/TD]
[TD]grapes[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]oranges to be picked up from farm[/TD]
[TD]oranges[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]oranges on the way to customer[/TD]
[TD]oranges[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]potatos are fresh from farm[/TD]
[TD]potatos[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]potatos saved lives[/TD]
[TD]potatos[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]potatos are the best of vegges[/TD]
[TD]potatos[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]oranges are the best of fruits[/TD]
[TD]oranges[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


I have tried to simplify the problem in the above example, but I have 100 search values and 1000s of text to look..
I am able to combine functions for these 4 search values, but there must be better way to do it, as I have 100s of search values. Kindly help
=IF(ISNUMBER(SEARCH(C$2,A2,1)),C$2,IF(ISNUMBER(SEARCH(C$3,A2,1)),C$3,IF(ISNUMBER(SEARCH(C$4,A2,1)),C$4,IF(ISNUMBER(SEARCH(C$5,A2,1)),C$5,0))))
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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