Search formula referencing range of keywords

M

Malvaro

I'll try to describe all the relevant information...

Column A - contains comment fields, randomly containing keyword(s)
Column B - contains the unknown search formula, yet to be determined
RangeXYZ - contains a list of multiple keywords

I wants the formula in B2 to search the comment field A2 using th
entire list of keywords found in RangeXYZ. The general assumption ca
be made that a comment field should only contain one keyword. I'd lik
A2 to result in a blank or "NA#" if nothing was found... or th
keyword, if any keyword was found.

For example:
A2 = "The customer was happy about their widget."
B2 = Unknown search formula, resulting in "widget"
RangeXYZ contains = widget, newspaper, sports car, computer
calculator

I hope that I provided enough information...

Thanks for any help or insight..
 
S

ShaneDevenshire

Hi Malvaro,

Assume your list of keywords is in a single column:

=IF(MATCH(FALSE,ISERR(SEARCH(J1:J3,A1)),0)>0,INDEX(J1:J3,MATCH(FALSE,ISERR(SEARCH(J1:J3,A1)),0),0),NA())

This is an array formula so it must be entered by pressing Shift+Ctrl+Enter,
not Enter. The range which you call XYZRange is J1:J3 in the above formula.
 
T

T. Valko

Try this:

=LOOKUP(1E100,SEARCH(F$2:F$7,A2),F$2:F$7)

Where F2:F7 is your list of keywords.
a comment field should only contain one keyword.

If a cell contains more than one keyword the result will be the matched
keyword listed *last* in the range F2:F7.
 
M

Malvaro

Thanks much! :)

T. Valko;687679 said:
Try this:

=LOOKUP(1E100,SEARCH(F$2:F$7,A2),F$2:F$7)

Where F2:F7 is your list of keywords.
-

If a cell contains more than one keyword the result will be the matche

keyword listed *last* in the range F2:F7.
 
M

Malvaro

Curious? Is there any way to show all the keywords found? If more tha
one happens to be found?
 
D

David Lillico

Hi,

This is working well for me, but, is it possible to enhance this to return a second column.

I want to find the keyword but return it's category from the same lookup.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top