user3289130
user3289130

Reputation: 13

Lookup Two Columns Against Two Columns in Excel

With two sheets, I'm looking to compare columns B and C from Sheet1 to columns A and B of Sheet2. If there is a match, record the value in column A from Sheet1 in column C of Sheet2.

Specifically, what would be a formula to place in Column C on Sheet2 to calculate the corresponding value from Column A on Sheet1?

Sheet1

    | A    | B         | C    | 
    | 1    | 1000    | A    | 
    | 2    | 2000    | B    | 
    | 3    | 3000    | C    | 
    | 4    | 4000    | D    | 

Sheet2

    | A          | B    | C | 
    | 3000    | C    |     | 
    | 2000    | B    |     | 
    | 3000    | C    |     | 
    | 1000    | A    |     | 

Sheet2 (desired output)

    | A          | B    | C  | 
    | 3000    | C    | 3   | 
    | 2000    | B    | 2   | 
    | 3000    | C    | 3   | 
    | 1000    | A    | 1   | 

Apologies if this particular issue has already been answered. I feel like this should be very simple, but I'm just not very experienced in these types of lookups.

Upvotes: 1

Views: 103

Answers (1)

Peter Albert
Peter Albert

Reputation: 17475

The easiest way is to insert a helper column in each sheet that defines a unique key.

To do so, insert a new column C in each sheet and populate it with this formula =A1&";"&B1.

Then, enter this formula in D1 (formerly C1) of sheet 2: =VLOOKUP(C1,Sheet1!$C:$D,2,0)

Upvotes: 1

Related Questions