Excel VLOOKUP
VLOOKUP finds a value in the first column of a table and returns the item from a column you choose by number.
An HR assistant receives a list of employee IDs and must add names and salaries from the master file. VLOOKUP is still everywhere in company workbooks, so even if you prefer newer functions you will need to read, repair and write it.
Practice it nowHow to write it
=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])- lookup_value
- What to find. It must be in the table's first column.
- table_array
- The whole table.
- col_index_num
- Which column to return, counting from 1.
- range_lookup
- Use FALSE for an exact match.
Watch it work
Examples
Who is employee 1003?
=VLOOKUP(1003,A2:D6,2,FALSE)InesColumn 2 of the table is Name.
What is employee 1004 paid?
=VLOOKUP(1004,A2:D6,4,FALSE)68,000Column 4 of the table is Salary.
Which department is 1002 in?
=VLOOKUP(1002,A2:D6,3,FALSE)ITSame search, different column number.
Your turn
Return the Salary of employee 1005. Type your formula in F2.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Employee ID | Name | Dept | Salary | ||
| 2 | 1001 | Grace | Finance | 62000 | ||
| 3 | 1002 | Hugo | IT | 71000 | ||
| 4 | 1003 | Ines | Sales | 54000 | ||
| 5 | 1004 | Jonas | IT | 68000 | ||
| 6 | 1005 | Kira | HR | 59000 | ||
| 7 |
Common mistakes
Leaving out FALSE.
VLOOKUP then assumes a sorted list and can return a wrong answer with no error.
Inserting a column inside the table.
The fixed column number now points at the wrong data.
Searching a column that is not the first.
Rearrange the table, or switch to XLOOKUP or INDEX and MATCH.
Good to know
- Lock the table with $A$2:$D$6 before copying the formula down.
- Approximate match is useful for grade or tax bands, provided the first column is sorted ascending.
- VLOOKUP or XLOOKUP? XLOOKUP is safer where it is available. VLOOKUP remains the choice for files shared with older versions of Excel.
Excelio