WPS Spreadsheet: Add Client IDs When Names Match in Two Excel Columns
Question details
The user needs to return a client ID when a client name in one column matches a name in a second column.

- Product
- WPS Spreadsheet
- Device & OS
- not provided
- Scenario
- Client names are listed in column D, the lookup names are in column B, and the corresponding client IDs are in column A.
- Observed behavior
- The client ID needs to be populated in column C for each matching name, with a blank returned when no match is found.
Confirm that client IDs are in column A, lookup names are in column B, and the names to check are in column D. Make sure the lookup range covers all expected rows and that names do not contain unintended extra spaces.
Use XLOOKUP to return the matching client ID
Use this method in current WPS Spreadsheet versions to match each name in column D with column B and return the related ID from column A.
XLOOKUP searches the second name column and returns the value from the corresponding row in the client ID column. The empty string argument keeps unmatched names blank instead of displaying an error.
Open the worksheet and select cell C2, or the first cell where the client ID should appear.
Type =XLOOKUP(D2,$B$2:$B$1000,$A$2:$A$1000,"") in the formula bar or directly in cell C2, then press Enter.
Select C2 and drag the fill handle down the remaining rows, or copy C2 and paste it into the rest of column C.
Use INDEX and MATCH for older spreadsheet versions
Use this compatible alternative when XLOOKUP is unavailable or when the workbook must support older Excel-style functions.
Match Names and Return Client IDs in WPS Spreadsheet
WPS Spreadsheet lets you use XLOOKUP to match names across columns and return related client IDs, while also supporting the INDEX and MATCH alternative for compatible workbooks. Its familiar spreadsheet interface makes it easy to enter, fill, and verify lookup formulas.
- 1. Open the workbook: Launch WPS Office, choose Spreadsheet, and open the workbook containing the client names and IDs.
- 2. Check the source columns: Verify that client IDs are in column A, matching names are in column B, and the names to search are in column D.
- 3. Enter the lookup formula: Select C2 and enter =XLOOKUP(D2,$B$2:$B$1000,$A$2:$A$1000,"").
- 4. Apply the formula: Press Enter, then drag the fill handle or copy and paste the formula down column C.

Frequently Asked Questions
What formula returns the client ID when the name matches?
In WPS Spreadsheet, enter =XLOOKUP(D2,$B$2:$B$1000,$A$2:$A$1000,"") in C2. This searches for the name in D2 within column B and returns the corresponding value from column A.
How can I avoid an error when a name is not found?
Use the fourth XLOOKUP argument as an empty string: =XLOOKUP(D2,$B$2:$B$1000,$A$2:$A$1000,""). For INDEX and MATCH, wrap the formula in IFERROR: =IFERROR(INDEX($A$2:$A$1000,MATCH(D2,$B$2:$B$1000,0)),"").
What can I use if XLOOKUP is unavailable?
Use =IFERROR(INDEX($A$2:$A$1000,MATCH(D2,$B$2:$B$1000,0)),"") in C2, then fill the formula down. MATCH locates the name and INDEX returns the client ID from the same row.
Why does the formula return a blank for a name that looks identical?
The names may contain leading, trailing, or inconsistent spaces, or slightly different spelling. Check the source cells and clean the names with TRIM when needed before running the lookup.




