Practice problems / Lookup & Reference

Fix VLOOKUP #N/A: the payroll export dropped the EMP- prefix

Hard Lookup & Reference Debug
Description
Hints 0/4
Solutions 3
–
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.

Diagnose before you fix

Symptom F2 shows #N/A even though the roster is visible and the ID looks right.
Cause Roster IDs are written EMP-1041 … EMP-1046, but E2 holds only 1043. Exact match compares the whole key, so no row qualifies.
Repair Rebuild the full key inside the formula, then keep the exact-match setting. Do not edit the roster.

The problem

Problem statement

The roster in A2:C7 stores every ID as EMP-1041 … EMP-1046. The payroll export only kept the bare number in E2. Team cell F2 returns #N/A. Diagnose the key mismatch and rebuild the key inside the formula.

Repair inside the formula — the roster is locked and the export cannot be re-run.

Problem data

Show the sheet as a table (selectable, copyable)
The exercise data, as a table
ABCEF
1 EmpNoNameTeamPayroll codeTeam
2 EMP-1041Aiko TanakaFinance1043
3 EMP-1042Bruno SilvaOps
4 EMP-1043Chen WeiSales
5 EMP-1044Dana OkaforSupport
6 EMP-1045Emil NovakFinance
7 EMP-1046Fatima HaddadOps

Notes

VLOOKUP compares the whole key exactly. The roster holds EMP-1043; the export holds 1043. Nothing matches, so the row is never found and the formula returns #N/A. Build the full key inside the formula with "EMP-"&E2 (or CONCAT / CONCATENATE) and keep FALSE so the comparison stays exact.

How to approach

Your answer goes in F2. On submit we re-run your formula against 3 different sets of input, so a hardcoded number will fail — the formula has to follow the cells.

  1. Target cell is F2 — the formula already there returns #N/A
  2. Compare E2 with the first column of the roster character by character
  3. The roster IDs carry a prefix that the payroll export lost
  4. Shape: =VLOOKUP("EMP-"&?, ?, 3, FALSE)

Official solutions

Show 3 solutions — try it yourself first

Approach 1: build the key with &

=VLOOKUP("EMP-"&E2,$A$2:$C$7,3,FALSE)

"EMP-"&E2 produces EMP-1043, which matches the key in A4. FALSE keeps the match exact; the third argument returns the Team column.

Approach 2: CONCATENATE

=VLOOKUP(CONCATENATE("EMP-",E2),$A$2:$C$7,3,FALSE)

CONCATENATE builds the same key without the & operator. It follows the payroll code just as well.

Approach 3: CONCAT

=VLOOKUP(CONCAT("EMP-",E2),$A$2:$C$7,3,FALSE)

CONCAT joins the prefix and E2 into the same key. It behaves like CONCATENATE here and keeps following E2 when the code changes.

Function guide

Related practice

FAQ

Why does VLOOKUP say #N/A when the ID is clearly there?

Because the two sides are not the same text. EMP-1043 and 1043 look related to a human and unrelated to a lookup: exact match compares every character.

Why repair the formula instead of the data?

The export is generated by another system and will be regenerated the same way. Building the key inside the formula survives every new export.