Practice / Lookup & Reference

Look up an employee's department (VLOOKUP)

Easy Lookup & Reference

You're in an HR screen and the interviewer slides over an employee directory: IDs, names and departments in A2:C5. Given the ID in E2, write a formula in the Department cell F2 that reports which department that employee works in.

The lookup must be an exact match — a near-miss ID would be worse than an error in an HR system.

Hints 0/4
Solutions 2
–
Test case
1
2
3
Reset
Submit
fx
A
B
C
D
E
F
G
1
2
3
4
5
6
7
8
9
10
Loading interactive spreadsheet...
Preparing grid cells and formula calculation engine
○ Ready Enter formula in highlighted cells, then click Submit.

Notes

This is the interview classic: VLOOKUP with FALSE. The ID must sit in the first column of the table range, the department is the 3rd column of A2:C5, and FALSE forces an exact match so a typo'd ID returns #N/A instead of the wrong person. Forgetting FALSE is the #1 reason candidates fail this question.

Function guide

FAQ

How do I look up an employee's department in Excel?

Put the ID in E2 and use =VLOOKUP(E2, A2:C5, 3, FALSE). The ID column must be the first column of the range, and 3 tells Excel to return the Department column.

Why does VLOOKUP need FALSE here?

IDs are exact values — there's no such thing as a 'close' employee ID. FALSE (or 0) forces an exact match, so a wrong ID returns #N/A, which you can catch with IFERROR, instead of silently returning another employee's department.

What's the most common mistake in VLOOKUP interview questions?

Leaving out the 4th argument. VLOOKUP then defaults to approximate match, which on unsorted text data returns a wrong row without any error — the exact failure mode interviewers test for.