Given two text lists, returns only those items from the second list that are found in the first list.
@Keywords( textList1 ; textList2 ) or @Keywords( textList1 ; textList2 ; separator )
textList1
Text list. A list of items.
textList2
Text list. A list of items that you want to compare to textList1.
separator
Text. One or more characters to be used as delimiters between words. @Keywords considers each character (not the combination of multiple characters) to be a delimiter. For example, defining separator as ". ," (period, space, comma) tells the function to separate the text at each period, space, and comma into separate words.
When you do not specify a separator, the following word delimiters are used by default:
?. ,!;:[](){}"<> (question mark, period, space, comma, exclamation point, semicolon, colon, (brackets, parentheses, braces, quotation mark, and angle brackets)
A null separator, represented by an empty string (""), tells the function to use no delimiters.
resultTextList
Text list. When a separator is in effect, either by default or specification, @Keywords parses textList1 into words delimited by the separator and returns any word that exactly matches a keyword in textList2. When no separator is in effect (when you specify a null separator), @Keywords returns any sequence of characters in textList1 that matches a keyword specified in textList2.
@Keywords(textList2;@Keywords(textList1;textList2))
When a keyword that you specify in textList2 is the very first word in the string you are searching AND you specify separators, @Keywords returns null. To prevent this behavior, prepend textList1 with one of the separators. For example, if you want to find the keyword, Sally, in a text list that contains employee names and positions, use the following formula:
@Keywords(" " + " ,Mary Halen, Director of Sales":" ,Sally Hall, VP of Marketing": " ,Joe Halzy, Order entry"; "Sally"; " ,")
This formula returns Sally. Note that one of the formula's separators, the space(" "), is prepended to textList1. This behavior does not occur if you accept the default separators or specify a null separator.
If one of the strings in textList2 contains any of the default delimiters, @Keywords will not return it. To search for Harvard University, for example, add a null separator to the formula. This tells @Keywords to search for any sequence of characters. If you do not specify a separator, you allow the default delimiters to act. @Keywords does not return Harvard University because when it parses textList1, it breaks the phrase into two separate words, Harvard and University, where it finds the space, which is a default delimiter.
When using the quotation mark separator ("), precede it with a backslash (\) to indicate that the quotation mark is a text constant.
This function is case-sensitive; you must standardize the case of textList1 and textList2 if you want case to be ignored (use @LowerCase, @ProperCase or @UpperCase).
@Keywords(@ProperCase("EPA Head speaks at Harvard and yale":"The UCLA Chancellor Retires":"Ohio State wins big game":"Reed and University of Oregon share research facilities");"Harvard":"Brown":"Stanford":"Yale":"Vassar":"UCLA")
@Keywords("EPA Head speaks at Harvard,Yale":"UCLA Chancellor Retires":"Ohio State wins big game":"Reed and University of Oregon share research facilities";"harvard":"brown":"stanford":"vassar":"ucla")
@Keywords("EPA Head speaks at Harvard, Yale hosts her next month":"UCLA Chancellor Retires":"Ohio State wins big game":"Reed and University of Oregon share research facilities";"Harvard":"Brown":"Stanford":"Yale":"UCLA";", ")
@Keywords("EPA Head speaks at Harvard, Yale University hosts her next month":"UCLA Chancellor Retires":"Ohio State wins big game":"Reed and University of Oregon share research facilities";"Harvard":"Brown":"Stanford":"Yale University":"UCLA"; "")
@Keywords(Applicants;"Mary Jones.";",")
@Keywords("," + Applicants;"Mary Jones.";",")
@Keywords("<booklist> XML tag that represents a list of our books.":"<book> XML tag that represents a book.":"<sale> XML tag that represents the sale price of a book.";"book";"<>")
@Keywords(list1;list2)
@Keywords(list2;@Keywords(list1;list2))