Comparing two columns in one Excel sheet, to two columns in another sheet, and if they match, copy data from another column

后端 未结 4 1626
死守一世寂寞
死守一世寂寞 2021-01-29 09:27

I\'ve been looking at using the Excel VLOOKUP function to accomplish this, but I\'m pretty unfamiliar with it.

I need to do the following:

On sheet one, column A

4条回答
  •  灰色年华
    2021-01-29 10:07

    You can enter in Sheet1!C1

    =INDEX(Sheet2!C:C,SUMPRODUCT(--(Sheet2!A:A=A1),--(Sheet2!B:B=B1),ROW(Sheet2!C:C)),0)
    

    and then copy downwards.

    This does not require:

    1. Using VBA
    2. Using array formulas
    3. Using an additional (helper) column.

    The importance of this is out of scope here.

    More details

    What you are looking for is typically called Multiple Lookup. There are quite a few questions about it in SO, and many other articles elsewhere. I have compiled here a list of such posts.

    There are many possible solutions for that. The one I found most robust is shown here. This is what I used in the present answer.

提交回复
热议问题