Check if a cell value is found in a column where cells may have multiple values then return a third cell value

这一生的挚爱 提交于 2020-01-25 09:22:17

问题


I am trying to check whether the value in each cell within Column A is in Column D. Some cells in Column D have multiple values within a single cell. If the value of Column A IS found in Column D then I want the formula to return what's in Column B (value next to Column A that matched).


回答1:


Try:

Formula in C2:

=IF(SUMPRODUCT(--(ISNUMBER(SEARCH(A2,$D$2:$D$5))))>0,B2,"")

Drag down..




回答2:


If you are looking at just row by row analysis then try this:

=if(iserror(search(a2,d2)),"",b2)

if you are trying to match any row in D then I suggest breaking out all items in D into an item per row and then doing a VLOOKUP




回答3:


Can you copy column B to Column E? If so,

=Vlookup("" & A1 & "", D:E, 2,0) and scroll down.

If not, a similar index(match( function will work with a wild card. (*)



来源:https://stackoverflow.com/questions/56977453/check-if-a-cell-value-is-found-in-a-column-where-cells-may-have-multiple-values

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