How to Find an Employee Name by Employee Number in Excel
Question details
The user needs to retrieve an employee's first and last name from a source dataset based on a specific employee number.

- 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.
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.
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.
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'.
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.
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.
The spreadsheet will automatically return the first name in your selected cell and populate the last name into the cell immediately to the right.

Combine First and Last Name in a Single Cell
Use this method if you need the employee's full name to appear in one single cell rather than spilling across two columns.
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. Open your roster in WPS Spreadsheet: Launch WPS Office and open your .xlsx file containing the employee numbers and names.
- 2. Apply the XLOOKUP function: Select the target cell and input your =XLOOKUP() formula to query the employee ID against your master list.
- 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.

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.




