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

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Domenic

MrExcel MVP
Joined
Mar 10, 2004
Messages
20,216
Office Version
  1. 365
Platform
  1. Windows
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!
 

dcxkraze

New Member
Joined
Oct 20, 2005
Messages
12
Wow,

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

Thanks a bunch.

Brandon
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,793
Messages
5,833,728
Members
430,228
Latest member
Normano

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
Top