Find Partial Text Matches in Excel with VLOOKUP or XLOOKUP
Question details
Find a shorter location name within a longer address or description and return the corresponding value from a lookup table.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A cell contains a location name, and the lookup table contains longer text entries that may include that name.
- Observed behavior
- The user wants a formula that finds a table entry containing the location name and returns its associated value.
Check that the shorter lookup text is in L15, the longer searchable entries are in C3:C33, and the values to return are in E3:E33. Adjust these references to match your worksheet and make sure L15 is not blank.
Use VLOOKUP with wildcards to find a partial text match
Use this formula when the searchable text is in the first column of the lookup table and the return value is to its right.
In Excel, click the cell where you want the matching value to appear.
Type =VLOOKUP("*"&L15&"*",$C$3:$E$33,3,FALSE) and press Enter.
Compare the returned value with the first entry in C3:C33 that contains the text in L15. Change the table range or column index 3 if your data is arranged differently.

Use XLOOKUP in wildcard mode
Use XLOOKUP when it is available in your Excel version and you want to specify the search and return ranges separately.
Find partial text matches in WPS Spreadsheets
Use a wildcard VLOOKUP formula in WPS Spreadsheets to find a location name inside longer text and return its associated value.
- 1. Open the spreadsheet: Open WPS Spreadsheets and use Open to select your workbook.
- 2. Check the lookup columns: Confirm that L15 contains the shorter location name, C3:C33 contains the longer text, and E3:E33 contains the values to return.
- 3. Enter the formula: Select an empty result cell, type =VLOOKUP("*"&L15&"*",$C$3:$E$33,3,FALSE), and press Enter.
- 4. Review and save: Check the returned value, then choose File > Save to save your changes.

Frequently Asked Questions
Why does VLOOKUP return #N/A for my partial match?
Check that L15 contains the shorter text and that the longer entries are in the first column of the VLOOKUP range. Also check for spelling differences or extra spaces, and use FALSE as the final argument.
What happens if more than one address contains the location name?
Both formulas shown return the first match they find in the search range. Review the matching rows if the location name may appear in more than one entry.
Can I search for a literal asterisk or question mark?
Yes. In Excel wildcard searches, place a tilde before a literal wildcard: use ~* for an asterisk and ~? for a question mark. Use ~~ to match a literal tilde.
Will these formulas work if L15 contains the full address instead?
Not for finding a shorter table entry inside that address. The formulas search for the text in L15 within the cells in the lookup column, so the shorter text needs to be in L15 for this setup.




