Function Problems

Use XLOOKUP to Match Text After Removing a Prefix in WPS Spreadsheets

Camila MilosovichCamila Milosovich Nov 12, 2026 869 views

Question details

Retrieve a related value when the lookup text includes an extra prefix that is not present in the reference list.

Use XLOOKUP to Match Text After Removing a Prefix in WPS Spreadsheets
Product
WPS Spreadsheets
Device & OS
not provided
Scenario
The user needs to look up a value from another worksheet or table, but the lookup cell contains a prefix such as "A " before the actual reference code.
Observed behavior
An exact XLOOKUP match cannot find the reference value until the unwanted prefix is removed from the lookup text.
Before you start

Confirm that the reference column contains the clean lookup values, such as 123 rather than A 123. Check that the prefix is written consistently in the source cells, including any spaces after the prefix.

Solution 1Recommended

Remove the prefix inside XLOOKUP with SUBSTITUTE

Use this method when every lookup value has the same unwanted prefix and you want to keep the original source value unchanged.

SUBSTITUTE creates a cleaned version of the lookup value before XLOOKUP searches the reference column. This lets you match the underlying code without adding a helper column.

1
Select the result cell

Click the cell where you want WPS Spreadsheets to return the matching value.

2
Enter an XLOOKUP formula with SUBSTITUTE

Type a formula such as =XLOOKUP(SUBSTITUTE(A11,"A ",""),ReferenceTable[refName],ReferenceTable[x]). Replace A11 with the cell containing the prefixed value, ReferenceTable[refName] with the clean lookup column, and ReferenceTable[x] with the return column.

3
Press Enter and fill the formula

Press Enter to return the matching value. Drag the fill handle down if you need to apply the formula to additional rows.

Remove the prefix inside XLOOKUP with SUBSTITUTE
The original value stays intact: This formula removes "A " only for the lookup calculation; it does not change the text stored in cell A11.
Work with lookup formulas in WPS Spreadsheets

Clean prefixed lookup text and return matching data with WPS Spreadsheets

WPS Spreadsheets lets you combine SUBSTITUTE and XLOOKUP to remove extra text from a lookup value and return the corresponding result from a reference table or another worksheet.

  1. 1. Open the workbook in WPS Spreadsheets: Open your .xlsx or .xls file and go to the worksheet that contains the prefixed lookup values.
  2. 2. Identify the source and reference fields: Locate the source cell with text such as A 123, the reference column containing 123, and the column that contains the value to return.
  3. 3. Build the cleaned lookup formula: In the result cell, enter =XLOOKUP(SUBSTITUTE(A11,"A ",""),ReferenceTable[refName],ReferenceTable[x]) and update the references for your workbook.
  4. 4. Confirm the returned result: Press Enter and verify that the returned value corresponds to the cleaned reference code.
Use SUBSTITUTE to remove a fixed prefix before an XLOOKUP match.Look up data across worksheets and structured reference tables.Open and edit Microsoft Excel .xlsx and .xls workbooks with formula compatibility.Use a familiar spreadsheet interface for formulas, tables, and fill operations.
microsoft office alternative - wps office

Frequently Asked Questions

How do I remove more than one possible prefix before an XLOOKUP?

Nest SUBSTITUTE functions in the lookup_value argument, such as =XLOOKUP(SUBSTITUTE(SUBSTITUTE(A11,"A ",""),"B ",""),lookup_array,return_array). If prefixes follow a pattern, a helper column may be easier to review.

Why does XLOOKUP still return an error after I remove the prefix?

Check for extra spaces, hidden characters, or a number-versus-text mismatch. You can remove ordinary spaces with TRIM, for example =XLOOKUP(TRIM(SUBSTITUTE(A11,"A ","")),lookup_array,return_array).

Can XLOOKUP search a reference list on another worksheet?

Yes. Use the other worksheet's ranges in the formula, such as =XLOOKUP(SUBSTITUTE(A11,"A ",""),'Reference Sheet'!A:A,'Reference Sheet'!B:B).

Will SUBSTITUTE change the value in my original lookup cell?

No. When used inside XLOOKUP, SUBSTITUTE only changes the text used during the formula calculation. The original content of the lookup cell remains unchanged.