VLOOKUP With Wildcards: Partial Match Lookups
By ExcelReady TeamUpdated 5 min read
The short answer
To use a wildcard in VLOOKUP, join an asterisk to the lookup value and keep FALSE for exact match: =VLOOKUP(""&F2&"",A2:C6,2,FALSE) finds the first row whose first column contains the text in F2. The asterisk means any characters, a question mark means exactly one, and a tilde lets you search for a real * or ?.
Key takeaways
- Wildcards work in VLOOKUP only with FALSE (exact match) and only on text.
- matches any number of characters; ? matches exactly one; ~ makes the next * or ? literal.
- ""&F2&"" means contains, F2&"" means starts with, and ""&F2 means ends with.
- VLOOKUP returns the first match only, so a short search word can pick the wrong row.
- Numbers stored as numbers can't be matched with wildcards; use a text helper column.
On this page+
A VLOOKUP wildcard lets you find a row when you only know part of the value, such as "Harbor" instead of "Blue Harbor Foods". You add an asterisk before and after the search text, keep FALSE as the last argument, and VLOOKUP returns the first row that contains your text. This guide covers the three wildcard characters, contains, starts-with and ends-with lookups, and the cases where wildcards don't work.
New to VLOOKUP itself? Start with the VLOOKUP guide for beginners.
How to use a wildcard in VLOOKUP#
Join an asterisk to each side of the lookup value with the & sign. All the examples use this customer list:
| A | B | C | |
|---|---|---|---|
| 1 | Company | Contact | City |
| 2 | Northwind Traders | Lisa Grant | Seattle |
| 3 | Blue Harbor Foods | Ahmed Khan | Boston |
| 4 | Greenleaf Supplies | Sofia Reyes | Denver |
| 5 | Summit Office Co | Daniel Park | Austin |
| 6 | Redwood Paper Ltd | Grace Holm | Portland |
With Harbor in F2, type:
=VLOOKUP("*"&F2&"*",A2:C6,2,FALSE)The result is Ahmed Khan. The lookup value becomes *Harbor*, which means "any text, then Harbor, then any text". Only Blue Harbor Foods fits.
The FALSE at the end is essential. Wildcards only work with an exact match. With TRUE, VLOOKUP treats the asterisk as a normal character and the result is unpredictable. The guide to VLOOKUP exact match explains why FALSE matters in general.
The three wildcard characters#
Excel has three wildcard characters, and they work the same way in VLOOKUP, COUNTIF, SUMIF and MATCH:
| Character | Meaning | Example | Matches |
|---|---|---|---|
* | Any number of characters, including none | "North*" | Northwind Traders, North |
? | Exactly one character | "Unit ?" | Unit A, Unit 7, not Unit 12 |
~ | The next * or ? is a real character | "A~*" | The text A* only |
The tilde is rarely needed, but it matters with product codes or notes that contain an asterisk or question mark. Without it, "A*" would match every value starting with A.
Contains, starts with and ends with#
Where you put the asterisk decides what kind of partial match you get:
| Lookup value | Meaning | With F2 = "Red" | Result (column 2) |
|---|---|---|---|
"*"&F2&"*" | Contains | *Red* | Grace Holm |
F2&"*" | Starts with | Red* | Grace Holm |
"*"&F2 | Ends with | *Red | #N/A |
"Ends with Red" fails because no company name ends in "Red". Starts-with lookups are safer than contains lookups, because they match fewer rows by accident.
The question mark is stricter than the asterisk, because it stands for exactly one character. =VLOOKUP("Summit Office C?",A2:C6,3,FALSE) returns Austin, because "Co" fills the pattern with one character after the C. "Summit Office Company" would not match, since it has more than one character there. Use ? when you know the length but not every letter, such as codes like "AB-1?".
You can also type the wildcard straight into the formula, such as =VLOOKUP("Summit*",A2:C6,3,FALSE), which returns Austin. Putting the search word in a cell is better, though, because you can change it without editing the formula.
VLOOKUP returns the first match only#
When more than one row matches, VLOOKUP returns the first one from the top. With F2 = "er", *er* matches both Northwind Traders and Redwood Paper Ltd. VLOOKUP returns Lisa Grant from row 2, even if you meant Redwood Paper. Short search words often match more than you expect, so check by counting first:
=COUNTIF(A2:A6,"*"&F2&"*")If this returns more than 1, make the search word longer or more specific. To see every match instead of the first, use FILTER with SEARCH in Microsoft 365: =FILTER(B2:B6,ISNUMBER(SEARCH(F2,A2:A6))). COUNTIF and SUMIF wildcards follow the same rules, as the wildcard criteria practice shows.
Wildcards don't work on numbers#
Wildcards only match text. If column A holds order numbers stored as real numbers, such as 10452, then "*452*" won't find it, and VLOOKUP returns #N/A.
The fix is a helper column that turns the numbers into text. Insert a column to the left of the table and fill it with =B2&"" (where B holds the numbers), then look up in the new column. Joining an empty string converts the number to text without changing how it looks. Leave the original column as numbers, so sums and sorting still work, and use the helper column only for the lookup.
If your lookup still returns #N/A with text data, the cause is often a hidden space or a missing quote. Work through the common reasons VLOOKUP stops working.
Wildcards in XLOOKUP#
XLOOKUP also supports wildcards, but only when you set its fifth argument, match_mode, to 2:
=XLOOKUP("*"&F2&"*",A2:A6,B2:B6,"Not found",2)With Harbor in F2, this returns Ahmed Khan, and it shows "Not found" instead of #N/A when nothing matches. Without the 2, XLOOKUP looks for a company literally called *Harbor*. XLOOKUP needs Excel 2021 or Microsoft 365.
Common mistakes with VLOOKUP wildcards#
- Asterisks outside the quotes.
=VLOOKUP(*&F2&*,...)is a syntax error. Each asterisk must be in double quotes:"*"&F2&"*". - Quotes around the cell.
"*F2*"searches for the letters F2. Join the cell with&. - TRUE or a missing last argument. Wildcards need FALSE.
- Searching numbers. Convert them to text first.
- Too short a search word. Check how many rows match with COUNTIF.
If you need to return several columns for the matched row, the guide to VLOOKUP returning multiple columns shows how, and the column index number explained helps you pick the right one. The VLOOKUP function guide is a quick syntax reference.
Practise it#
Partial matches are easy once you've built a few lookup values by hand. Practise wildcards in criteria in a live spreadsheet: you type the formula and it checks the result instantly. Then practise VLOOKUP to combine wildcards with exact-match lookups.
Try it yourself
This is a live spreadsheet. Type the formula in the green cell and press Enter.
Find the contact for the company whose name contains the word in F2. In G2, write a VLOOKUP that searches A2:C6 for "*"&F2&"*" and returns column 2, with FALSE.
| A | B | C | D | E | F | G | H | |
|---|---|---|---|---|---|---|---|---|
| 1 | City | Contact | ||||||
| 2 | Seattle | Harbor | ||||||
| 3 | Boston | |||||||
| 4 | Denver | |||||||
| 5 | Austin | |||||||
| 6 | Portland | |||||||
| 7 | ||||||||
| 8 | ||||||||
| 9 |
Tip: Build the lookup value as "*"&F2&"*", then the table A2:C6, column 2 and FALSE.
Practise this in a lesson
Frequently asked questions
Can VLOOKUP do a partial match?
Yes. Join asterisks to the lookup value, like =VLOOKUP(""&F2&"",A2:C6,2,FALSE). VLOOKUP then finds the first row whose first column contains the text in F2.
Why is my VLOOKUP wildcard not working?
Check that the last argument is FALSE, that the asterisks are in double quotes and joined with &, and that the column holds text. Wildcards don't match real numbers.
Is VLOOKUP with wildcards case-sensitive?
No. =VLOOKUP("harbor",A2:C6,2,FALSE) finds Blue Harbor Foods. VLOOKUP ignores capitals with or without wildcards.
How do I look up a value that contains an asterisk?
Put a tilde before it. =VLOOKUP("A~",A2:C6,2,FALSE) looks for the text A exactly, instead of treating * as a wildcard.
Does XLOOKUP support wildcards?
Yes, but only when you set the fifth argument, match_mode, to 2: =XLOOKUP(""&F2&"",A2:A6,B2:B6,"Not found",2). Without it, XLOOKUP treats * as a normal character.