1
votes

I have an Excel workbook with two sheets. The first sheet has two columns: ID and Date. The second also has those columns, but it has a lot of IDs that aren't in sheet 1; sheet 1 has 897 and sheet 2 has 1002. I'm trying to use a VLookup to find each ID in sheet 2 and paste the start date into the column in sheet 2.

When I do it like this, it pastes the value in column two from the second sheet instead of the first.

=VLOOKUP(A2,Sheet1!$A$2:Sheet1!$B$900,2,FALSE)

When I add an indirect reference (=VLOOKUP(INDIRECT(A2),Sheet1!$A$2:Sheet1!$B$900,2,FALSE)), it gives me a reference error.

Any idea what I'm doing wrong?

1
What is the order of the columns in sheet 1?teylyn
I doubt this is related to your problem, but what version of Excel are you using? I could not recreate your issue.puzzlepiece87

1 Answers

1
votes

Vlookup tries to find a match in the first column of the lookup table and returns the value from the column number specified.

The formula =VLOOKUP(A2,Sheet1!$A$2:Sheet1!$B$900,2,FALSE) will try to find the value that is in cell A2 on the current sheet in column A on Sheet1 and will return the value from the second column (column B) where an exact match is found.

If that result is not what you expect to see, you need to re-arrange your data or use a different formula.