How to Find Exact Substrings in Excel Part Numbers
Question details
The user needs an Excel formula to find exact space-separated words (like NPTF) in a cell without falsely matching partial text inside longer words (like NPTFS).

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Searching for specific part numbers or exact substrings within a cell containing multiple space-separated words.
- Observed behavior
- Standard search functions often return false positives by finding partial matches inside longer words instead of evaluating exact whole words.
Ensure your target words (e.g., NPTF, NPS, UNF) are listed in a separate reference range (like F2:F4) and that you are using a version of Excel or WPS Spreadsheet that supports modern dynamic array functions like TEXTSPLIT.
Use TEXTSPLIT and XMATCH for Row-by-Row Matching
This method splits the cell contents into individual words and checks for exact matches against a predefined list.
By splitting the text using a space delimiter, you guarantee that only whole words are evaluated, preventing partial matches from triggering a false positive.
Enter the exact substrings you want to find (e.g., NPTF, NPS, UNF) into a range of cells, such as F2:F4.
In cell B2, input the following formula: =OR(ISNUMBER(XMATCH(TEXTSPLIT(A2," "),$F$2:$F$4)))
Press the Enter key, then click and drag the fill handle at the bottom-right corner of cell B2 down to apply the formula to the rest of your dataset.

Use BYROW for an Automatic Spill Result
Ideal for processing an entire column at once without needing to drag the fill handle down manually.
Use WPS Spreadsheet to Handle Complex Array Formulas
WPS Spreadsheet fully supports advanced dynamic array formulas, making it incredibly easy to extract, match, and manipulate text strings in your datasets.
- 1. Open your data in WPS Spreadsheet: Launch WPS Office and open your workbook containing the part numbers.
- 2. Input your reference data: Type your exact target substrings in a separate column range to serve as your lookup array.
- 3. Apply the array formula: Paste the provided XMATCH and TEXTSPLIT formula into your target cell to instantly identify exact word matches.

Frequently Asked Questions
Why am I getting a #SPILL! error when using the BYROW formula?
A #SPILL! error occurs when the dynamic array formula tries to output results into multiple cells, but one or more of those destination cells already contain data. To fix it, simply clear the obstruction in the cells below the formula so it has enough space to spill the results.
Will this formula match case-sensitive substrings?
By default, the XMATCH function is not case-sensitive. If you need a strict case-sensitive match, you would need to incorporate the EXACT function into your formula logic instead of relying solely on XMATCH.
Can I use a different delimiter besides a space?
Yes. In the TEXTSPLIT(A2," ") portion of the formula, you can replace the space character with any other delimiter your data uses, such as a comma (",") or a hyphen ("-").




