Function Problems

How to Find an Employee Name by Employee Number in Excel

Emma BrownEmma Brown Nov 10, 2026 868 views

Question details

The user needs to retrieve an employee's first and last name from a source dataset based on a specific employee number.

How to Find an Employee Name by Employee Number in Excel
Product
Excel
Device & OS
not provided
Scenario
Looking up employee details from a master roster or attendance tracking sheet using a unique employee ID.
Observed behavior
Return the first and last name associated with the queried employee number, optionally spilling across adjacent columns.
Before you start

Ensure your source dataset is organized into clear columns (e.g., First Name, Last Name, and Employee Number) and contains no duplicate ID numbers to guarantee accurate lookup results.

Solution 1Recommended

Use the XLOOKUP Function to Retrieve Names

XLOOKUP is the most efficient method to search for a value in one column and return corresponding data from multiple adjacent columns simultaneously.

The XLOOKUP function provides a highly flexible way to look up information. Unlike older functions, it can search left or right of the lookup array. In modern spreadsheet tools, it also supports spilling, meaning you can pull both the first and last names at once without writing multiple formulas.

1
Identify your source data range

Locate your master dataset containing the employee information. For example, assume your source Employee Numbers are in column C, First Names are in column A, and Last Names are in column B on a tab named 'Sheet 1'.

2
Select the destination cell

Click the cell where you want the employee's first name to appear. Ensure the adjacent cell to its right is empty so the last name can spill into it.

3
Enter the XLOOKUP formula

Type the formula =XLOOKUP(A2, 'Sheet 1'!$C$2:$C$1000, 'Sheet 1'!$A$2:$B$1000, "") where A2 contains the employee number you are searching for. Press Enter.

4
Review the spilled results

The spreadsheet will automatically return the first name in your selected cell and populate the last name into the cell immediately to the right.

Use the XLOOKUP Function to Retrieve Names
Handling missing data: The empty quotation marks ("") at the end of the formula tell XLOOKUP to return a blank cell instead of an ugly #N/A error if the employee number is not found.
Efficient Data Processing with WPS

Easily Find Employee Data with WPS Spreadsheet

WPS Spreadsheet provides comprehensive support for modern data lookup functions like XLOOKUP, allowing you to instantly retrieve and manage complex employee datasets. It is a lightweight, fully-featured alternative that simplifies data processing.

  1. 1. Open your roster in WPS Spreadsheet: Launch WPS Office and open your .xlsx file containing the employee numbers and names.
  2. 2. Apply the XLOOKUP function: Select the target cell and input your =XLOOKUP() formula to query the employee ID against your master list.
  3. 3. Auto-fill your dataset: Double-click the small square at the bottom right corner of the cell to instantly apply the formula to thousands of employee records.
100% compatible with Microsoft Excel (.xlsx) formats and advanced formulas including XLOOKUP.Lightweight application that loads massive employee datasets quickly without lagging.Intuitive user interface that makes writing and auditing complex formulas easier.Free built-in data analysis tools for managing attendance and roster tracking.
microsoft office alternative - wps office

Frequently Asked Questions

Why is my XLOOKUP formula returning a #N/A error?

The #N/A error occurs when the exact employee number cannot be found in the lookup array. Ensure there are no leading or trailing spaces in your source data and that your referenced range covers all the employee records.

What if I am using an older version of Excel that doesn't have XLOOKUP?

If your spreadsheet software does not support XLOOKUP, you can use an INDEX and MATCH combination. For example: =INDEX('Sheet 1'!$A$2:$B$1000, MATCH(A2, 'Sheet 1'!$C$2:$C$1000, 0), 1) for the first name.

Why does my XLOOKUP formula say #SPILL!?

A #SPILL! error indicates that XLOOKUP is trying to return results into multiple cells (like both first and last names), but the adjacent cell it needs to fill is not empty. Clear the data from the blocking cell to resolve this.