Excel: Check if Cell value exists in Column, and return a value in the same row but different column

时光怂恿深爱的人放手 提交于 2019-12-06 05:50:30

I think the following formula should give you what you are trying to get. If I understand your question correctly, you want to return the value in column F that is in the same row as the match: hence, the range I use for column F is the same length as the range for column A.

  =IFERROR(INDEX($F$2:$F$1589,MATCH(O2,$A$2:$A$1589,0),1),"no match")

Working outward, here is what is going on.

  • The match function is looking in column A for an exact match of the value in O2.

    If it finds a match, it returns the relative position of the matching value in the column A lookup range.

    If it finds no match, it returns an error value.

  • The index function returns the value in the i th row and j th column of the index range, in this case the row that was found in the match, and the first (and only) column in the index range, column F.

  • Finally, those two functions are wrapped in an IFERROR function, to catch the error value that will be generated if there is no match, and return instead the string "no match".

This formula would be entered in cell P2 and copied down through the last row of data in column O.

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