问题
I want to return the corresponding matched keyword that is contained in Column A, but I dont know the Excel query to be used.
Please can you help?
The details are as follows:
Column A - List of Firms I need to match the Keywords Against (Column C)
Column B - If the list of Keywords match the cell in Column A return the Matching value here
Column C - Match these keywords to text in Column A, I am looking for a contains match rather than a Exact Match
Here is the file in question: https://www.dropbox.com/s/zwrqzb60vnadgu8/Test.xlsx?dl=0
回答1:
Here are a couple of suggestions to be entered in B2 and pulled down:-
(1) Case sensitive, must be entered as an array formula, gives last match if more than one matching keyword:-
=INDEX(C$2:C$5,MAX(ROW(C$2:C$5)*(1-ISERROR(FIND(C$2:C$5,A3))))-1)
(2) Not case sensitive, an ordinary formula, gives first match if more than one matching keyword:-
=INDEX($C$2:$C$5,MATCH(TRUE,INDEX(ISNUMBER(SEARCH($C$2:$C$5,A2)),,),0))
Note that "Affinity Investment Group" won't match because the keyword is "Investments" (plural).
This is the second version with an IFERROR test added so that it shows an empty cell when there is no match:-
来源:https://stackoverflow.com/questions/27603660/excel-cell-contains-a-value-from-a-list-return-list-value