-1

I have a excel file with 2 work sheets. They look like this:

Sheet 1:

sheet1

Sheet 2:

sheet2

I want to look up the value of column A (sheet1) when matched with column A (sheet 2) copy the value of column B (sheet 2) to column B (sheet 1).

I know I have to use vlookup but I really have no idea where to start with this.

An example of the result:

wanted result

1 Answer 1

2

VLOOKUP works by taking a square range of data, looking at the first column of that data for a match you specify, and then returning the value of that row a given number of columns to the right. For example, in your case, it would look as follows [for B2 in sheet1, copied down]:

=VLOOKUP(A2,'Sheet2'!A:B, 2, FALSE)

This takes the value from cell A2, then looks at column A on sheet2. If it finds a match, it returns the value on the 2nd column of the table [ie: column B]. If there is no match, it will return #N/A. The FALSE means that it doesn't assume your data is sorted [if it is, you can use VLOOKUP to take a 'next best' value if there is no match.

3
  • It actually has to use ; instead of ,. But even then it's giving me an error . #NAME?
    – Bram
    Nov 24, 2015 at 14:51
  • @BramDriesen - Make sure you edit the sheet name, if yours is actually Sheet 2, then use that (note the space).
    – BruceWayne
    Nov 24, 2015 at 15:22
  • 1
    @BramDriesen ";" or "," is based on locale/language settings. As Bruce points out, #NAME? error indicates that you don't have a sheet named Sheet2. Fix the name to what you actually have, and it should work. Nov 24, 2015 at 19:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.