Excel - Cell Contains a Value from a List - Return list value

扶醉桌前 提交于 2021-02-07 11:13:56

问题


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:-

enter image description here



来源:https://stackoverflow.com/questions/27603660/excel-cell-contains-a-value-from-a-list-return-list-value

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!