vlookup to find match and return another element in row

感情迁移 提交于 2019-12-04 17:48:51

Modify and put this formula into the first cell of the second column on the first worksheet. Then copy and paste it down the column:

=VLOOKUP(A1, Sheet2!A$1:B$100, 2, FALSE)

Let's look at the parameters for this function:

  1. A1: This value, on this worksheet, is what we're searching for in the range given in the next parameter. When you copy and paste the entire formula down the column, it increments the row # with each row. In row 2, it will be modified to A2, and so on.

  2. Sheet2!A$1:B$100 : This is the range that we are interested in, on the second worksheet. It is the top left to bottom right cell. The $ symbol tells Excel not to change the row #'s when you copy and paste the formula down the column. Modify B$100 to fit the range of data you are interested in... something like B$30 if you only have 30 rows of id's on the 2nd sheet.

  3. 2: This is the column you are interested in retrieving the value, relative to the above parameter. In this case, the 2 corresponds with column B.

  4. False: This instructs Excel to find the exact match.

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