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.

TextDesired OutputSearch values
Ten oranges have been soldorangesoranges
Yet to sell 15 potatospotatobananas
oranges shippedorangesgrapes
potatos under inspectionpotatospotatas
grapes are sweet grapes
oranges to be picked up from farmoranges
oranges on the way to customeroranges
potatos are fresh from farmpotatos
potatos saved livespotatos
potatos are the best of veggespotatos
oranges are the best of fruitsoranges

<colgroup><col span="2"><col></colgroup><tbody>
</tbody>
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
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.

TextDesired OutputSearch values
Ten oranges have been soldorangesoranges
Yet to sell 15 potatospotatobananas
oranges shippedorangesgrapes
potatos under inspectionpotatospotatas
grapes are sweetgrapes
oranges to be picked up from farmoranges
oranges on the way to customeroranges
potatos are fresh from farmpotatos
potatos saved livespotatos
potatos are the best of veggespotatos
oranges are the best of fruitsoranges

<tbody>
</tbody>


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,214,932
Messages
6,122,323
Members
449,077
Latest member
jmsotelo

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