FormulaCraft

How to do a lookup with wildcards in Excel and Google Sheets

Topic:Lookups (any direction)
Excel & Google Sheets
=VLOOKUP("*"&D2&"*",$A$2:$B$5,2,0)

Verified example

Computed by a real spreadsheet engine on the sample data below.

ProductPrice
Blue Widget29.99
Red Gadget49.99
Green Doohickey14.99
Blue Thingamajig39.99

=VLOOKUP("*"&D2&"*",$A$2:$B$5,2,0)29.99

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1Type the partial text to search for in a cell (e.g. D2).
  2. 2In the result cell, enter =VLOOKUP("*"&D2&"*",$A$2:$B$5,2,0).
  3. 3The "*"&D2&"*" builds a wildcard pattern that matches any value containing D2 anywhere in the text.
  4. 4The formula returns the value from column 2 for the first match found.

Tips

Working on a sheet you inherited? Run the Auditor on the whole file first — it flags every #REF!, #N/A, broken column pattern, and inconsistent formula in seconds, free, no signup.

Frequently asked

Does XLOOKUP support wildcards?

Yes — in XLOOKUP, set match_mode to 2 to enable wildcard matching: =XLOOKUP("*"&D2&"*",A2:A5,B2:B5,,2).

What if I want to search only at the start of the text?

Remove the leading wildcard: =VLOOKUP(D2&"*",$A$2:$B$5,2,0) to match values that begin with D2.

More on Lookups (any direction)

See all →

Formulas used

Related tasks

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: