Is there a way to inner join two different Excel spreadsheets using VLOOKUP?
In SQL, I would do it this way:
SELECT id, name
FROM Sheet1
INNER JOIN Sheet2
ON Sheet1.id = Sheet2.id;
Sheet1:
+----+------+
| ID | Name |
+----+------+
| 1 | A |
| 2 | B |
| 3 | C |
| 4 | D |
+----+------+
Sheet2:
+----+-----+
| ID | Age |
+----+-----+
| 1 | 20 |
| 2 | 21 |
| 4 | 22 |
+----+-----+
And the result would be:
+----+------+
| ID | Name |
+----+------+
| 1 | A |
| 2 | B |
| 4 | D |
+----+------+
How can I do this in VLOOKUP? Or is there a better way to do this besides VLOOKUP?
Thanks.
=VLOOKUP(Sheet2!A1,Sheet1!A:B,2,False)
Where column A:A in both sheets hold the id and Column B on Sheet 1 has the name. It would go in B1 in Sheet 2 and copied down. – Geodynamics