Function Problems

Use XLOOKUP with Wildcards to Find Codes in Text in WPS Spreadsheets

Natalie TaylorNatalie Taylor Nov 13, 2026 869 views

Question details

Find a product code embedded inside longer cell text by using XLOOKUP with wildcard matching instead of a VLOOKUP wildcard formula that failed.

Use XLOOKUP with Wildcards to Find Codes in Text in WPS Spreadsheets
Product
WPS Office Spreadsheets
Device & OS
not provided
Scenario
The user has a code to look up and a table where that code may appear anywhere within the cell text, and needs to return the matching related value.
Observed behavior
A VLOOKUP wildcard formula did not return the expected match; XLOOKUP with match mode 2 can search for the code anywhere within the cell text.
Before you start

Open your workbook in WPS Office Spreadsheets and confirm that XLOOKUP is available in your version. Identify the lookup range, the return range, and the cell containing the code to search for.

Solution 1Recommended

Use XLOOKUP with Match Mode 2 and Asterisk Wildcards

Use this when the lookup code may appear anywhere inside the cell text and you need a reliable wildcard match.

Wildcard matching uses asterisks as placeholders for any number of characters, so the code can be found even when it appears before, after, or between other text in the cell.

1
Select the formula cell

Click the cell where you want the matched code or related product value to appear.

2
Enter the XLOOKUP formula

Type =XLOOKUP("*"&A17&"*",A14:A100,B14:B100,,2) and press Enter. Replace A17 with the cell containing the code, A14:A100 with the lookup range, and B14:B100 with the return range.

3
Adjust the ranges for your worksheet

Make sure the lookup range and return range are the same size and cover all rows that may contain the code and the value to return.

Use XLOOKUP with Match Mode 2 and Asterisk Wildcards
Wildcard match found: The formula returns the first matching row because match mode 2 enables wildcard matching in WPS Spreadsheets.
WPS Spreadsheets tutorial

How to Use XLOOKUP Wildcards in WPS Office Spreadsheets

Open your workbook in WPS Office Spreadsheets and use XLOOKUP with match mode 2 to find codes embedded in longer text. This keeps formulas concise and returns the correct product code without restructuring your data.

  1. 1. Open your workbook in WPS Spreadsheets: Launch WPS Office, click Open, and select the workbook that contains the lookup table and product codes.
  2. 2. Select the result cell: Click the cell where the matched code or returned value should appear.
  3. 3. Enter the XLOOKUP wildcard formula: Type =XLOOKUP("*"&A17&"*",A14:A100,B14:B100,,2) and adjust A17, the lookup range, and the return range to match your worksheet.
  4. 4. Verify the wildcard match: Press Enter and confirm that WPS Spreadsheets returns the first matching row where the code appears anywhere in the lookup cell.
Wildcard lookup matches product codes anywhere in cell text without splitting columnsFull compatibility with Microsoft Excel .xlsx formulas and workbook structureFree spreadsheet features with familiar XLOOKUP and lookup functionsLightweight WPS Office app with easy formula editing and range selection
microsoft office alternative - wps office

Frequently Asked Questions

Why does my VLOOKUP wildcard formula fail but XLOOKUP works?

VLOOKUP wildcard matching can fail when ranges, column positions, or match options are not configured correctly. XLOOKUP lets you set match mode 2 directly, which enables wildcard matching and separates the lookup range from the return range.

What does match mode 2 mean in XLOOKUP?

Match mode 2 tells XLOOKUP to use wildcard characters such as asterisks. An asterisk represents any number of characters, so "*"&A17&"*" finds the value in A17 anywhere inside the lookup cell.

Can XLOOKUP search for a code anywhere inside a cell?

Yes. Adding an asterisk before and after the code with "*"&A17&"*" tells XLOOKUP to match the code even when it appears among other text in the cell.

Does WPS Spreadsheets support XLOOKUP?

Current versions of WPS Office Spreadsheets support XLOOKUP. If the function is not recognized, update WPS Office to the latest version or use an INDEX MATCH wildcard formula as a fallback.

How do I find the first matching code when multiple cells contain similar text?

XLOOKUP returns the first match from top to bottom in the lookup range. Make sure the lookup range contains only the rows you want to search, and use unique codes where possible.