Excel Formulas for Partial Match Searching with Wildcards

📅 Sep 20, 2026 📝 Sarah Miller

Locating specific records within massive Excel datasets can be incredibly frustrating when you only possess partial or inconsistent information. While traditional exact-match functions like standard XLOOKUP or VLOOKUP fall short in these scenarios, integrating wildcard characters grants users the flexibility to execute dynamic, partial-match queries effortlessly. However, as a vital stipulation, these wildcard operators-such as the asterisk (*) for multiple characters-only function seamlessly with text-based data. For instance, searching "Proj*" will instantly retrieve "Project Alpha." Below, we will explore the precise formula configurations and best practices required to master wildcard searches in your spreadsheets.

Excel Formulas for Partial Match Searching with Wildcards

Excel is an incredibly powerful tool for data analysis, but real-world data is rarely perfect. You will often find yourself needing to search for records where you only have a piece of the puzzle-such as finding a customer name when you only know their last name, or locating a product ID based on a partial sequence. This is where partial matching with wildcards becomes an invaluable skill.

In this guide, we will explore how to perform partial matches in Excel using wildcards combined with some of the most popular lookup and logical functions, including VLOOKUP, XLOOKUP, INDEX/MATCH, COUNTIF, and SEARCH. By the end of this article, you will be able to tackle even the most disorganized datasets with ease.


Understanding Excel Wildcards

Before diving into formulas, it is essential to understand the three wildcard characters that Excel recognizes. These characters act as placeholders for unknown data:

  • Asterisk (*): Represents any number of characters (zero or more). For example, "ex*" matches "excel", "extra", or just "ex".
  • Question Mark (?): Represents exactly one single character. For example, "t?n" matches "tan", "ten", or "tin", but not "teen".
  • Tilde (~): Acts as an escape character. If you need to search for a literal asterisk or question mark, you place a tilde before it (e.g., "~*" or "~?").

Let's look at how to leverage these characters in various real-world formulas.


1. Partial Match with VLOOKUP

The traditional VLOOKUP function is designed for exact matches, but by concatenating wildcard characters to your search term, you can easily convert it into a partial match powerhouse.

The Formula Syntax

=VLOOKUP("*" & lookup_value & "*", table_array, col_index_num, FALSE)

How It Works

By using the ampersand (&) operator, we wrap the lookup_value (which can be a text string or a cell reference) in asterisks. This tells Excel: "Find any text that contains this value, regardless of what characters come before or after it." Note that the last argument must be set to FALSE (or 0) to ensure Excel performs an exact match on the pattern we constructed.

Example

Suppose you have a list of employee names in column A and their department in column B. You want to find the department of "Smith", but the cell actually contains "John Smith".

=VLOOKUP("*Smith*", A2:B10, 2, FALSE)

If "Smith" is stored in cell D2, the formula would look like this:

=VLOOKUP("*" & D2 & "*", A2:B10, 2, FALSE)

2. Modern Partial Matches with XLOOKUP

If you are using Microsoft 365 or Excel 2021 and newer, XLOOKUP is the preferred lookup tool. It is safer, more flexible, and handles wildcards natively-provided you change one specific argument.

The Formula Syntax

=XLOOKUP("*" & lookup_value & "*", lookup_array, return_array, [if_not_found], 2)

The Magic "2" Argument

By default, XLOOKUP searches for an exact match. To enable wildcards, you must set the 5th argument (match_mode) to 2. Without this, Excel will literally search for the characters "*" and "&" in your data.

Example

If you want to find the price of an item containing "Phone" in column A and return the price from column B:

=XLOOKUP("*Phone*", A2:A20, B2:B20, "Not Found", 2)

3. INDEX and MATCH for Advanced Partial Matches

For older Excel versions where XLOOKUP isn't available, or when you need to perform a leftward lookup (which VLOOKUP cannot do), the INDEX and MATCH combination is your best option.

The Formula Syntax

=INDEX(return_array, MATCH("*" & lookup_value & "*", lookup_array, 0))

How It Works

The MATCH function identifies the relative row number of the partial match, and INDEX retrieves the corresponding value from your target column. Like VLOOKUP, we concatenate the asterisks to our search cell, and we use 0 in the third argument of MATCH for an exact pattern match.


4. Counting Partial Matches with COUNTIF

Sometimes, you don't want to extract data; you simply want to count how many times a partial phrase appears in a list. The COUNTIF and COUNTIFS functions support wildcards natively without any special settings.

Example: Counting Specific Product Codes

Imagine a column of inventory codes. You want to count how many codes start with the letters "AB" and are followed by exactly 3 characters.

=COUNTIF(A2:A100, "AB???")

In this scenario, each question mark (?) represents exactly one character, ensuring you only count codes that are exactly 5 characters long and start with "AB".

Example: Counting Containment

To count how many items contain the word "Red" anywhere in their description:

=COUNTIF(B2:B100, "*Red*")

5. Dynamic Filtering with SEARCH and ISNUMBER

For more advanced logic-such as filtering lists, creating conditional formatting rules, or constructing array formulas-the combination of ISNUMBER and SEARCH is incredibly robust.

While the FIND function is case-sensitive and does not support wildcards, the SEARCH function is case-insensitive and natively supports wildcards.

The Formula Syntax

=ISNUMBER(SEARCH(lookup_value, text_to_search))

How It Works

  1. SEARCH looks for the lookup value inside the text. If it finds it, it returns its starting character position (a number). If it doesn't, it returns a #VALUE! error.
  2. ISNUMBER checks the result. If it gets a number, it returns TRUE. If it gets an error, it returns FALSE.

You can use this inside an IF statement to categorize your data dynamically:

=IF(ISNUMBER(SEARCH("North*", A2)), "Northern Region", "Other")

Handling Literal Wildcards

What happens if your actual data contains wildcards? For example, what if you are searching for the string "Discontinued*" where the asterisk is part of the actual text?

To tell Excel not to treat the asterisk as a wildcard, prefix it with a tilde (~):

=VLOOKUP("Discontinued~*", A2:B10, 2, FALSE)

This escape sequence works across all lookup and matching functions in Excel.


Best Practices and Pitfalls to Avoid

  • Watch Out for Multiple Matches: Lookup functions like VLOOKUP and XLOOKUP only return the first match they encounter. If you have "Apple iPhone" and "Google Pixel Phone", searching for "*Phone*" will only return the data for the iPhone.
  • Performance Issues: Wildcard lookups require Excel to scan through datasets sequentially. On massive workbooks with tens of thousands of rows, heavy use of wildcard formulas can slow down calculation times.
  • Leading Wildcards: Searching with a leading asterisk (e.g., "*value") is particularly resource-intensive because Excel cannot use its indexing optimizations and must scan every cell completely.

Summary Table of Partial Match Formulas

Function Formula Example Best Used For
VLOOKUP =VLOOKUP("*"&D2&"*", A2:B10, 2, FALSE) Quick, traditional vertical lookups.
XLOOKUP =XLOOKUP("*"&D2&"*", A2:A10, B2:B10, , 2) Modern, safe lookups with flexible return columns.
INDEX/MATCH =INDEX(B2:B10, MATCH("*"&D2&"*", A2:A10, 0)) Leftward lookups in older versions of Excel.
COUNTIF =COUNTIF(A2:A10, "*text*") Counting partial matches in a range.
ISNUMBER/SEARCH =ISNUMBER(SEARCH("text", A2)) Logical tests, filtering, and conditional formatting.

By mastering wildcards and combining them with these versatile Excel formulas, you can navigate messy datasets, construct dynamic search boxes, and automate data retrieval with remarkable precision.

Disclaimer:
The documents and templates provided on this page are for informational and illustrative purposes only. They do not constitute professional, legal, or financial advice, and should not be relied upon as such. Because individual circumstances and regulatory requirements vary, these materials may not be suitable for your specific needs. We recommend consulting with a qualified professional before adapting or using any of these examples for official or commercial purposes.