Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 11
Default Search formula referencing range of keywords

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 the entire list of keywords found in RangeXYZ. The general assumption can be made that a comment field should only contain one keyword. I'd like A2 to result in a blank or "NA#" if nothing was found... or the 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...
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,344
Default Search formula referencing range of keywords

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),N A())

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.

--
Cheers,
Shane Devenshire


"Malvaro" wrote:


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 the
entire list of keywords found in RangeXYZ. The general assumption can
be made that a comment field should only contain one keyword. I'd like
A2 to result in a blank or "NA#" if nothing was found... or the
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...




--
Malvaro

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Search formula referencing range of keywords

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.


--
Biff
Microsoft Excel MVP


"Malvaro" wrote in message
...

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 the
entire list of keywords found in RangeXYZ. The general assumption can
be made that a comment field should only contain one keyword. I'd like
A2 to result in a blank or "NA#" if nothing was found... or the
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...




--
Malvaro



  #4   Report Post  
Junior Member
 
Posts: 11
Default

Thanks much! :)

Quote:
Originally Posted by T. Valko View Post
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.


--
Biff
Microsoft Excel MVP


"Malvaro" wrote in message
...

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 the
entire list of keywords found in RangeXYZ. The general assumption can
be made that a comment field should only contain one keyword. I'd like
A2 to result in a blank or "NA#" if nothing was found... or the
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...




--
Malvaro
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Search formula referencing range of keywords

You're welcome!

--
Biff
Microsoft Excel MVP


"Malvaro" wrote in message
...

Thanks much! :)

T. Valko;687679 Wrote:
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.


--
Biff
Microsoft Excel MVP


"Malvaro" wrote in message
...-

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 the
entire list of keywords found in RangeXYZ. The general assumption

can
be made that a comment field should only contain one keyword. I'd

like
A2 to result in a blank or "NA#" if nothing was found... or the
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...




--
Malvaro -





--
Malvaro





  #6   Report Post  
Junior Member
 
Posts: 11
Default

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

Quote:
Originally Posted by T. Valko View Post
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.


--
Biff
Microsoft Excel MVP
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I search for keywords in cells containing text? Fredrik Excel Worksheet Functions 4 June 28th 07 01:56 PM
Need Help!! Want to search through 3 columns for a list of keywords The Moose Excel Worksheet Functions 7 January 2nd 07 03:12 AM
Keyword search, several keywords Doman Excel Discussion (Misc queries) 1 July 24th 06 10:58 AM
#VALUE! On An Array Formula Referencing a Range Outside The Workbo paige Excel Discussion (Misc queries) 5 September 9th 05 12:05 AM
can i make a formula to search keywords in a excel workbook? gorillayam Excel Worksheet Functions 0 January 15th 05 02:25 AM


All times are GMT +1. The time now is 12:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"