Fix VLOOKUP #N/A: the payroll export dropped the EMP- prefix
Diagnose before you fix
#N/A even though the roster is visible and the ID looks right. 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)
| A | B | C | E | F | |
|---|---|---|---|---|---|
| 1 | EmpNo | Name | Team | Payroll code | Team |
| 2 | EMP-1041 | Aiko Tanaka | Finance | 1043 | |
| 3 | EMP-1042 | Bruno Silva | Ops | ||
| 4 | EMP-1043 | Chen Wei | Sales | ||
| 5 | EMP-1044 | Dana Okafor | Support | ||
| 6 | EMP-1045 | Emil Novak | Finance | ||
| 7 | EMP-1046 | Fatima Haddad | Ops |
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.
- Target cell is F2 — the formula already there returns
#N/A - Compare E2 with the first column of the roster character by character
- The roster IDs carry a prefix that the payroll export lost
- 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
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.