Search code examples
excelvlookup

Excel vlookup help


Using vlookup, when a match occurs, I want to display the value of column C from sheet 2 from the same row where the match occurred. The formula I came up with takes the value from column C sheet 2 but it takes it from the row where the formula is pasted on sheet 3 instead of where the match occurred.

Here's my formula that doesn't work:

=IF(VLOOKUP(Sheet1!A:A,Sheet2!A:A,1,FALSE),Sheet2!C:C,"NODATA")

How can I take the value from the row where the match occurred?


Solution

  • You need to manually get the index you're looking for, then get the value at that index:

    =INDEX(Sheet2!C:C, MATCH(Sheet1!A:A,Sheet2!A:A,FALSE))