Wildcards in VLOOKUP: How to Use * and ?

Formulas & functions · Updated November 23, 2026

Yes, VLOOKUP supports wildcards: use the asterisk (*) to match any sequence of characters and the question mark (?) to match a single character. For example, =VLOOKUP("*"&A1&"*",B2:C100,2,FALSE) finds the first value in B2:B100 that contains the text in A1, then returns the matching value from column C.

How Wildcards Work in VLOOKUP

VLOOKUP’s fourth argument (range_lookup) controls wildcard behavior. Set it to FALSE (or 0) to enable wildcards; set it to TRUE (or omit it) and Excel performs an approximate match, which ignores wildcards entirely. When FALSE is used, Excel treats the lookup value as a pattern:

  • * – matches zero or more characters. "*cat*" matches “cat”, “concatenate”, and “category”.
  • ? – matches exactly one character. "b?g" matches “bag”, “beg”, and “big”, but not “bg”.
  • ~ – escapes the next character, so you can search for a literal asterisk or question mark. "~*" matches an actual asterisk.

Important: wildcards only work with text values. If your lookup column contains numbers, VLOOKUP with a wildcard pattern will return #N/A. You may need to convert numbers to text first, for example by using TEXT in a helper column.

Practical Examples of Wildcard VLOOKUP

Assume you have a product list in A2:C10, with product codes in A, names in B, and prices in C. You want to find the price of the first product whose name contains “wire”.

  1. In cell E2, type the search term: wire
  2. In cell F2, enter: =VLOOKUP("*"&E2&"*",B2:C10,2,FALSE)
  3. Press Enter. Excel returns the price from the first row where column B contains “wire” (e.g., “Wireless Mouse” returns its price).

If you want to match a code that starts with “AB” and has exactly three more characters, use: =VLOOKUP("AB???",A2:C10,3,FALSE). This matches “AB123”, “ABXYZ”, but not “AB12” or “AB1234”.

To find a literal asterisk in the lookup column, use: =VLOOKUP("~*",A2:C10,2,FALSE). This finds the first cell that is exactly an asterisk character.

Choosing Between Wildcard and Exact Match

Use wildcards when you need partial matching: searching for a substring, a pattern, or when the lookup value has extra characters you want to ignore. Use exact match (with FALSE but no wildcards) when you need a precise identifier like an ID or a SKU. Wildcards can cause false positives – for example, searching for “cat” with *cat* will also return “concatenate”. If your data has many similar terms, consider using FILTER (Excel 2021 or Microsoft 365) to return all matches instead of just the first.

Also note that VLOOKUP always returns the first match in the lookup column. If you need the last match or all matches, use XLOOKUP with the match_mode argument set to 2 (wildcard) and the search_mode set to -1 (search last-to-first).

Common Problems and How to Fix Them

Here are the most frequent issues users hit:

  • #N/A despite a visible match – Check that the fourth argument is FALSE (or 0). If it’s TRUE or omitted, wildcards are ignored and Excel does an approximate match, which may fail if the column isn’t sorted.
  • Wildcard not working with numbers – Convert numbers to text. For example, create a helper column with =TEXT(A2,"0") and use that column as the lookup range.
  • Literal asterisk or question mark not found – Use the tilde escape: "~*" or "~?".
  • Case sensitivity – VLOOKUP is not case-sensitive. If you need case-sensitive matching, use XLOOKUP with the match_mode set to 2 and then wrap in EXACT in a helper column, or use INDEX/MATCH with EXACT.
  • Leading/trailing spaces – Wildcards will match spaces too. Use TRIM on the lookup value and the data, or use "*"&TRIM(A1)&"*".

Alternatives to VLOOKUP with Wildcards

Modern Excel offers better options:

  • XLOOKUP (Excel 2021 or Microsoft 365) – Use =XLOOKUP("*"&E2&"*",B2:B10,C2:C10,,2). The fifth argument (match_mode) set to 2 enables wildcards. It’s simpler and more flexible.
  • FILTER (Excel 2021 or Microsoft 365) – Returns all matches: =FILTER(C2:C10,ISNUMBER(SEARCH(E2,B2:B10))). This is not a wildcard in the VLOOKUP sense, but it achieves partial matching and returns an array.
  • INDEX/MATCH – Works in all versions, but you need to combine with SEARCH or ISNUMBER to mimic wildcards: =INDEX(C2:C10,MATCH(1,ISNUMBER(SEARCH(E2,B2:B10)))*1,0)) – enter as an array formula with Ctrl+Shift+Enter in older versions.

For Google Sheets, the same wildcard rules apply to VLOOKUP, but XLOOKUP is not available; use FILTER or REGEXMATCH instead.

Performance and Data Size Considerations

VLOOKUP with wildcards is slower than exact match because Excel must scan each cell and evaluate the pattern. On large datasets (tens of thousands of rows), this can noticeably slow down calculations. To improve performance:

  • Limit the lookup range to the exact columns and rows needed, not entire columns.
  • Use XLOOKUP if available – it’s optimized and often faster.
  • Avoid using wildcards on both ends if you only need a prefix match, e.g., "AB*" instead of "*AB*".
  • Consider adding a helper column that extracts the searchable part using LEFT, MID, or FIND, then use exact match on that column.

Also be aware that wildcard matching is not case-sensitive, but it does respect the exact characters including spaces and punctuation. If your data has inconsistent spacing, normalize it with TRIM and CLEAN before running the lookup.

Frequently Asked Questions

Can I use wildcards in VLOOKUP with TRUE (approximate match)? No. When range_lookup is TRUE, Excel ignores wildcards and performs an approximate match on sorted data. You must use FALSE to enable wildcards.

How do I match a literal question mark? Use "~?". The tilde escapes the question mark, so VLOOKUP looks for an actual question mark character.

Does VLOOKUP wildcard work with numbers stored as text? Yes, if the lookup column contains text. If numbers are stored as numbers, convert them to text first, for example with =TEXT(A2,"0") in a helper column.

Why does my wildcard VLOOKUP return the wrong row? VLOOKUP returns the first match in the lookup column. If your data has duplicates or the pattern is too broad, you may get an unexpected row. Use XLOOKUP with search_mode to find the last match, or FILTER to see all matches.

Can I use wildcards in VLOOKUP across multiple sheets? Yes, just reference the other sheet in the table_array, e.g., =VLOOKUP("*"&A1&"*",Sheet2!A:B,2,FALSE). The wildcard rules remain the same.

Is there a way to make VLOOKUP case-sensitive with wildcards? No, VLOOKUP is inherently case-insensitive. Use XLOOKUP with match_mode 2 and then wrap the result in EXACT in a helper column, or use INDEX/MATCH with EXACT and an array formula.

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.