Find Embedded Text with VLOOKUP in Excel and WPS Spreadsheets
Question details
Find a lookup value embedded within a longer text string without changing the source data.

- Product
- Microsoft Excel and WPS Spreadsheets
- Device & OS
- not provided
- Scenario
- A lookup value such as 314-645 appears within a longer string in the first column of a lookup range.
- Observed behavior
- The formula needs to identify the embedded text and return a value from the matching row.
Identify the cell containing the lookup text and the columns containing the source strings and return values. The examples assume the lookup value is in A2, source strings are in Sheet2 column A, and return values are in Sheet2 column B.
Use VLOOKUP with wildcards to match embedded text
Use this formula when the source text is in the first column of the lookup range and the return value is to its right.
Click the cell where you want to display the matching value.
Type =VLOOKUP("*"&A2&"*",Sheet2!A:B,2,FALSE) and press Enter. The asterisks allow text before and after the value in A2, while FALSE enables an exact wildcard match.
Compare the returned value with the first matching row on Sheet2. Adjust A2, Sheet2!A:B, or the column number 2 if your data is arranged differently.

Use INDEX and MATCH for an embedded-text lookup
Use INDEX and MATCH when you want to specify the lookup and return columns separately.
Look up embedded text in WPS Spreadsheets
Use a wildcard VLOOKUP formula in WPS Spreadsheets to find a value within a longer text string and return data from the matching row.
- 1. Open the workbook: Open WPS Spreadsheets and select Open to load your workbook.
- 2. Identify the lookup columns: Locate the lookup value and the source and return columns. For this example, use A2 and Sheet2 columns A and B.
- 3. Enter VLOOKUP: Click the result cell, enter =VLOOKUP("*"&A2&"*",Sheet2!A:B,2,FALSE), and press Enter.
- 4. Review and save: Check the returned value against the first matching row, then select Save to keep the formula.

Frequently Asked Questions
Why does the formula return #N/A?
No matching text may exist in the lookup column. Check the value in A2 and the source range on Sheet2 for differences such as extra spaces or punctuation.
What happens if more than one source string contains the lookup value?
Both VLOOKUP and MATCH return the first match in the lookup range. Check the source rows if multiple strings could contain the same value.
Can I return a value from a column to the left of the matching text?
Yes. Use INDEX and MATCH with the return column in INDEX and the text column in MATCH, such as =INDEX(Sheet2!A:A,MATCH("*"&A2&"*",Sheet2!B:B,0)).
What if my lookup text contains an asterisk or question mark?
An asterisk or question mark is treated as a wildcard. To match it literally, escape it with a tilde. For a cell value, use SUBSTITUTE to escape tildes first, then asterisks and question marks before adding the surrounding wildcards.




