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?
 

Some videos you may like

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.

Domenic

MrExcel MVP
Joined
Mar 10, 2004
Messages
19,403
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
 

Watch MrExcel Video

Forum statistics

Threads
1,118,430
Messages
5,572,065
Members
412,437
Latest member
PietTheijssen
Top