Function Problems

Fix Excel VLOOKUP Errors with Employee and Course Criteria

Maira MehtabMaira Mehtab Nov 18, 2026 869 views

Question details

Find out why a VLOOKUP using an employee name and course title returns errors for some training courses.

Fix Excel VLOOKUP Errors with Employee and Course Criteria
Product
Microsoft Excel
Device & OS
not provided
Scenario
An employee training lookup combines a name and course title to find a matching record in an export table.
Observed behavior
The lookup works for most courses but returns an error for certain courses.
Before you start

Compare the lookup value with the key in the export table and identify the employee, course, and result columns. Check whether the export key contains both the employee name and course title or only the employee name.

Solution 1Recommended

Create a Matching Employee and Course Key

Use this method when the result must match both an employee and a specific course.

VLOOKUP searches the first column of its lookup range. Build the same combined key in both the reference table and the lookup formula.

1
Arrange the reference columns

In the export table, place a helper column in A, employee names in B, course titles in C, and the value to return in D. Adjust these column references if your table is arranged differently.

2
Build the combined key

In cell A2, enter =TRIM(B2)&"|"&TRIM(C2), then fill the formula down the helper column. This joins the name and course with a separator and removes ordinary extra spaces.

3
Look up both criteria

If the employee name to find is in F2 and the course title is in G2, enter =VLOOKUP(TRIM(F2)&"|"&TRIM(G2),$A$2:$D$100,4,FALSE) in the result cell. Adjust the range to include all reference rows.

4
Check unmatched records

If a cell still shows #N/A, compare the employee name and course title in F2 and G2 with the corresponding entries in columns B and C. Correct spelling, text differences, or unusual spaces in the source data.

Create a Matching Employee and Course Key
Check for duplicate keys: VLOOKUP returns the first matching row. If the same employee and course appear more than once, decide which record should be returned before using the formula.
Work with training data in WPS

Use WPS Spreadsheets to Match Employees and Courses

Open your training workbook in WPS Spreadsheets and use a helper column with VLOOKUP to match each employee and course.

  1. 1. Open the workbook: In WPS Spreadsheets, select Open and choose your Excel training workbook.
  2. 2. Create a helper key: With employee names in column B and courses in column C, enter =TRIM(B2)&"|"&TRIM(C2) in A2 and fill it down.
  3. 3. Enter the lookup: With lookup criteria in F2 and G2 and results in column D, enter =VLOOKUP(TRIM(F2)&"|"&TRIM(G2),$A$2:$D$100,4,FALSE) in the result cell. Adjust the range to fit your table.
  4. 4. Save the workbook: Select File > Save As and choose an Excel format such as XLSX.
Match training records using employee and course criteriaOpen and edit Microsoft Excel XLSX and XLS filesUse familiar spreadsheet formulas and an easy-to-use interfaceWork with spreadsheets using the free version of WPS Office
microsoft office alternative - wps office

Frequently Asked Questions

Why does VLOOKUP return #N/A for only some courses?

The combined lookup value may differ from the export table key because of spelling, spacing, or a missing course title. Compare the affected employee and course values with the first column of the lookup range.

Can VLOOKUP match both an employee and a course?

Yes. Create a helper column that joins the employee name and course title, then use the same combination as the lookup value. Put the helper column first in the VLOOKUP range and use FALSE for an exact match.

What happens if two rows have the same employee and course key?

VLOOKUP returns the value from the first matching row in the selected range. Check the reference table for duplicates and decide which record you need.

Will TRIM remove every kind of extra space?

No. TRIM removes ordinary extra spaces, but some imported data may contain nonbreaking spaces or other characters. Inspect and clean those characters in the source cells if the values still do not match.