VLOOKUP Partial Match: Wildcards & Other Ways

Formulas & functions · Updated November 22, 2026

To perform a partial match with VLOOKUP in Excel, use wildcard characters: the asterisk (*) for any sequence of characters or the question mark (?) for a single character. For example, =VLOOKUP("*"&A1&"*",B:C,2,FALSE) finds the first value in column B that contains the text in A1 and returns the matching value from column C.

How Wildcards Work in VLOOKUP

Wildcards are special characters that stand in for other characters. In Excel, there are three: * (any number of characters), ? (exactly one character), and ~ (escape character, used to find a literal asterisk or question mark). When you use them in the lookup_value argument of VLOOKUP, Excel treats them as pattern matchers, not literal text.

For instance, to find a name that starts with “Jo” in a list, you’d use "Jo*". To find a 5-character code where the third character is “X”, use "??X??". To find a literal asterisk in a cell, use "~*".

Important: wildcards only work when the last argument of VLOOKUP is FALSE (exact match). If you set it to TRUE (approximate match), Excel ignores wildcards and performs a standard lookup. Always use FALSE for partial matching.

Building a Partial Match Formula

Assume you have a list of product codes in column A (A2:A100) and prices in column B (B2:B100). You want to find the price for a code that contains “AB12” anywhere. Put the search text in cell D1, then in E1 enter:

=VLOOKUP("*"&D1&"*",A:B,2,FALSE)

This concatenates asterisks around the cell value, so if D1 contains “AB12”, the lookup value becomes “*AB12*”. Excel finds the first code in column A that contains “AB12” and returns the price from column B. If no match is found, the formula returns #N/A.

For a match that starts with the text, omit the leading asterisk: =VLOOKUP(D1&"*",A:B,2,FALSE). For a match that ends with the text, omit the trailing asterisk.

Using Cell References and Concatenation

Hardcoding wildcards inside quotes works, but it’s more flexible to reference a cell. The ampersand (&) is Excel’s concatenation operator, joining text strings. In the formula above, "*"&D1&"*" builds the pattern dynamically. You can also use the CONCATENATE function, but & is shorter.

Be careful with cells that contain wildcard characters themselves. If D1 contains an asterisk, Excel will treat it as a wildcard, not a literal character. To search for a literal asterisk, you need to escape it with a tilde: "~*". For example, to find a code that contains “A*B”, use "*A~*B*".

Common Problems and Fixes

  • #N/A error: No match found. Check that the wildcard pattern is correct and that the lookup column is the first column in the table array.
  • Wrong result: VLOOKUP returns the first match, not the best or last. If multiple rows contain the pattern, you get the first one. To get the last match, use LOOKUP with a different approach.
  • Wildcards not working: Ensure the fourth argument is FALSE. Also, if your data contains numbers, Excel may not treat them as text. Convert to text or use the TEXT function.
  • Case sensitivity: VLOOKUP is not case-sensitive. “abc” matches “ABC”. If you need case-sensitive matching, use XLOOKUP with the match_mode argument, or use INDEX/MATCH with EXACT.

Alternatives: XLOOKUP, INDEX/MATCH, and FILTER

XLOOKUP (available in Excel 2021 and Microsoft 365) is a modern replacement. It supports wildcards directly and allows you to specify the match mode. The syntax is =XLOOKUP("*"&D1&"*",A:A,B:B,"not found",2) where the 2 means wildcard match. XLOOKUP also lets you search from the last to first, and it doesn’t require the lookup column to be the first in the range.

INDEX/MATCH is another classic alternative. For a partial match, use =INDEX(B:B,MATCH("*"&D1&"*",A:A,0)). This works similarly to VLOOKUP but gives you more control over the columns.

For multiple matches, use the FILTER function (Microsoft 365): =FILTER(B:B,ISNUMBER(SEARCH(D1,A:A))). This returns all prices where the code contains D1. SEARCH is case-insensitive; use FIND for case-sensitive.

Performance and Large Data Sets

Wildcard lookups are slower than exact matches because Excel scans each cell in the lookup column until it finds a match. On large datasets (tens of thousands of rows), this can cause noticeable lag. To speed things up, consider using a helper column with a formula that extracts a key, or use Power Query to pre-process data. Also, avoid using full-column references like A:A; instead, use a defined range like A2:A1000.

If you need to perform many partial lookups, consider converting data to an Excel Table (Ctrl+T) and using structured references, which can improve performance and readability.

Frequently Asked Questions

Can VLOOKUP find a partial match without wildcards? No. VLOOKUP only performs exact or approximate matches. Approximate match (TRUE) finds the closest value, but it doesn’t do substring matching. You must use wildcards for partial matches.

Why does my VLOOKUP return the first match, not the one I want? VLOOKUP always returns the first match in the lookup column. If you need a different occurrence, you’ll need to use INDEX/MATCH with an array formula, or use XLOOKUP with the search mode set to “search from last” (for the last match).

How do I match a partial string that contains a wildcard character like * or ? Use the tilde (~) to escape. For example, to find “A*B”, use "*A~*B*". The tilde tells Excel to treat the next character literally.

Does VLOOKUP work with numbers and dates for partial matches? Yes, but you need to convert them to text. For numbers, use TEXT(A1,"0") or format the cell as text. For dates, use TEXT(A1,"mm/dd/yyyy") to match the displayed format.

Is there a way to do a partial match in Google Sheets? Yes, VLOOKUP works the same way with wildcards in Google Sheets. The syntax is identical. For more advanced partial matching, you can use REGEXMATCH with FILTER, but VLOOKUP with wildcards is simpler.

Related

Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.

More in Formulas & functions

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.