Search a text string for multiple terms and choose 1

dcxkraze

New Member
Joined
Oct 20, 2005
Messages
12
Any tips on the following:

Column A is a long list of paragraph long text strings. In Column B I want to search the strings in column A for 1 of the 10 following terms. If more than 1 were to show up at a time, I would need to pull the first.

Sample Column A Cell:

"...contract was up for bid in Los Angeles for two multi-stage..."

List of 10 terms to search for in Column B

1) Los Angeles
2) New York
3) Chicago
4) San Francisco
5) San Diego
6) Orange County
7) Dallas
8) Atlanta
9) Boston
10) Washington DC

Is this feasible or extremely difficult?
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Assuming that D1:D10 contain your list of 10 terms for which to search,

B1, copied down:

=INDEX($D$1:$D$10,MATCH(TRUE,ISNUMBER(SEARCH($D$1:$D$10,A1)),0))

...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.

Hope this helps!
 
Upvote 0
Wow,

That's great, works perfectly. Need to reverse engineer that and understand how you did it.

Thanks a bunch.

Brandon
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,728
Members
448,987
Latest member
marion_davis

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