VLOOKUP a number key
PremiumIn G2, use VLOOKUP to return the Salary of the employee whose ID is in F2.
| A | B | C | D | E | F | G | H | |
|---|---|---|---|---|---|---|---|---|
| 1 | ID | Name | Department | Salary | ID | Salary | ||
| 2 | 101 | Maria | Sales | 42000 | 103 | |||
| 3 | 102 | Jonas | Finance | 51000 | ||||
| 4 | 103 | Sofie | IT | 58000 | ||||
| 5 | 104 | Lars | Sales | 39500 | ||||
| 6 | 105 | Emma | HR | 46000 | ||||
| 7 | ||||||||
| 8 |
Premium lesson
Unlock VLOOKUP and every other lesson
This is a premium lesson. Premium lets you solve it and every other lesson, take the timed mock tests, and earn certificates you can share on LinkedIn.
It comes up in this mock test: Excel assessment (Indeed format)
Your first month for $9.50 $19
50% off your first month when you join today.
Then $19/month. Cancel any time, and get a full refund within 14 days if it isn't for you.
Why this works
The lookup value doesn't have to be text: VLOOKUP finds 103 in the ID column and returns the 4th column, Salary. A number stored as text won't match a real number, though.
Common mistake: Typing the ID in quotes, like "103". The IDs are numbers, and the text "103" won't match them.
The answer
- G2
=VLOOKUP(1F2,2A2:D6,34,4FALSE)
In plain words: Find 1the ID in F2 in the first column of 2A2:D6 and return 3the fourth column, the salary, 4only on an exact match.