You receive a file with only Employee IDs. HR asks you to add employee name, department, manager and salary from the employee master. VLOOKUP can search the employee ID and return the matching details.
What does VLOOKUP do?
VLOOKUP searches for a value in the first column of a table and returns a related value from another column to the right.
VLOOKUP formula structure
Basic syntax
Example: =VLOOKUP(B4,'Employee Master'!A:H,2,FALSE)
This searches the Employee ID in B4 inside the first column of A:H and returns the 2nd column, which is Employee Name.
Business examples
| Need | Formula | Result |
|---|---|---|
| Find employee name | =VLOOKUP(B4,Master!A:H,2,FALSE) | Aarav Shah |
| Find department | =VLOOKUP(B4,Master!A:H,3,FALSE) | Sales |
| Wrong employee ID | =IFERROR(VLOOKUP(B4,Master!A:H,2,FALSE),"Not Found") | Not Found |
When to use and when not to use VLOOKUP
Interview question
Question: What is the limitation of VLOOKUP?
Answer: VLOOKUP searches only in the first column of the selected table array and returns values from columns to the right. It also depends on column index numbers, which can break if columns are inserted or moved.
Fetch employee details using VLOOKUP
Download one ZIP file containing the practice workbook, challenge workbook, solution workbook, formula cheat sheet, quiz and answer key.
Mini assignment
- Use VLOOKUP to fetch Employee Name.
- Use VLOOKUP to fetch Department, Location and Manager.
- Use VLOOKUP to fetch Salary and Joining Year.
- Use FALSE for exact match.
- Use IFERROR to show “Not Found” for missing IDs.
Quick quiz
- What does VLOOKUP do?
- What does FALSE mean?
- What is column index number?
- Why use IFERROR?
Answers: Looks up a value and returns related data; exact match; column number to return; clean error handling.