Mastering Excel Lookup Formulas for Partial Text and Wildcards

📅 Mar 01, 2026 📝 Sarah Miller

Managing inconsistent spreadsheets often leads to frustration when standard lookup functions fail due to imperfectly matched data. While exact-match formulas like traditional XLOOKUP or VLOOKUP are the standard for structured databases, real-world data is rarely uniform. Mastering wildcard characters grants you the flexibility to retrieve critical information without requiring flawless data entry. Note this key stipulation: wildcards only function with text-based data, not raw numbers. For example, searching "*Corp*" will easily locate "Microsoft Corp" within a database. Below, we outline the exact formula syntax required to implement these dynamic partial lookups in your reports.

Mastering Excel Lookup Formulas for Partial Text and Wildcards

In the world of data analysis, we rarely work with perfect, pristine datasets. More often than not, you will find yourself dealing with inconsistent strings, partial entries, or system-generated descriptions that contain extra characters. For instance, you might have a transaction list containing "AMZN MKTP US*12345" when you simply want to match it against "Amazon".

When a standard exact match lookup fails, Excel's wildcard characters come to the rescue. By combining traditional lookup functions with wildcards, you can search for partial text matches with surgical precision. In this comprehensive guide, we will explore how to perform partial text lookups using VLOOKUP, INDEX & MATCH, and the modern XLOOKUP, complete with step-by-step examples and best practices.

Understanding Excel's Wildcard Characters

Before diving into the formulas, it is essential to understand the three wildcard characters that Excel supports. These characters act as placeholders in your search criteria:

  • Asterisk (*): Represents any number of characters. For example, "Ap*" can match "Apple", "April", or "Application". Similarly, "*apple*" will match any string containing the word "apple" anywhere inside it.
  • Question Mark (?): Represents a single character. For example, "H?at" can match "Heat", "Hat ", or "Hurt", but not "Heart".
  • Tilde (~): Acts as an escape character. If you need to search for an actual asterisk or question mark in your text, you place a tilde before it (e.g., "~*" or "~?").

Method 1: Partial Match using VLOOKUP

The VLOOKUP function is the classic workhorse of Excel. To perform a partial lookup, you must concatenate the wildcard character directly with your lookup value using the ampersand (&) operator.

The Formula Syntax

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

Step-by-Step Example

Imagine you have a list of raw transaction descriptions and you want to pull the simplified brand name and category from a reference table. Let's look at the structure below:

Reference Table (Columns A:B) Transaction List (Column D) Result (Column E)
Brand (Col A) | Category (Col B) Raw Description Category Lookup
Netflix | Entertainment NETFLIX.COM ENTRTNMNT Formula goes here
Amazon | Shopping AMZN MKTP US*8891 Formula goes here
Starbucks | Food & Dining STARBUCKS COFFEE #542 Formula goes here

To find the category for the "NETFLIX.COM ENTRTNMNT" transaction using a partial lookup of our reference table, you can enter the following formula in cell E2:

=VLOOKUP("*" & A2 & "*", D2:D4, 1, FALSE)

However, more commonly, you want to search for a clean keyword (like "Netflix") within a messy raw string. To do that, the formula structure switches so that the wildcard looks inside the target lookup cell. If you are searching for a simplified term inside a longer string within your lookup column, the syntax remains highly versatile:

=VLOOKUP("*" & "Netflix" & "*", D2:E4, 2, FALSE)

Note: VLOOKUP is case-insensitive, meaning "netflix" and "NETFLIX" are treated exactly the same.

Method 2: Flexible Lookups with INDEX and MATCH

While VLOOKUP is straightforward, it suffers from several limitations: it can only search the leftmost column of your table array, and it can be slow on large datasets. The INDEX and MATCH combination overcomes these issues and offers a robust alternative for partial text matching.

The Formula Syntax

=INDEX(return_range, MATCH("*" & lookup_value & "*", lookup_range, 0))

How It Works

The MATCH function handles the wildcard lookup. By setting its third argument to 0 (exact match), you instruct Excel to find the exact relative position of the partial string within the lookup range. Once MATCH returns the row index, INDEX retrieves the corresponding value from your return range.

Example Scenario

Suppose you have the following dataset where you want to retrieve an Employee ID based on a partial first name lookup:

  • Lookup Range (Column B): Full Name (e.g., "Johnathan Smith", "Mary Jane Watson")
  • Return Range (Column A): Employee ID (e.g., "EMP102", "EMP105")
  • Search Criteria (Cell D2): "John"

Because the return range (Employee ID) is to the left of the lookup range (Full Name), VLOOKUP cannot be used without restructuring the sheet. Instead, you use the following INDEX and MATCH formula:

=INDEX(A2:A10, MATCH("*" & D2 & "*", B2:B10, 0))

This formula searches Column B for any cell containing "John", finds "Johnathan Smith" in row 2, and returns the corresponding Employee ID from Column A.

Method 3: Modern Lookups with XLOOKUP

If you are using Microsoft 365 or Excel 2021 and later, XLOOKUP is the ultimate tool for this task. It simplifies syntax, naturally searches in any direction, and includes built-in error handling. However, unlike older functions, XLOOKUP does not search with wildcards by default. You must explicitly enable wildcard matching via its fifth argument.

The Formula Syntax

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

To enable wildcard searches, you must set the match_mode parameter to 2.

Example

Using the same Employee ID example, your modern XLOOKUP formula looks like this:

=XLOOKUP("*" & D2 & "*", B2:B10, A2:A10, "No Match Found", 2)

This formula search matches any cell containing the text in D2 within the array B2:B10, returns the value from A2:A10, handles missing data by displaying "No Match Found", and specifies wildcard matching with the 2 argument.

Advanced: Case-Sensitive Partial Text Lookup

Standard lookup formulas in Excel are case-insensitive. If you need to distinguish between "apple" and "Apple", wildcards inside VLOOKUP or XLOOKUP won't cut it. To perform a case-sensitive partial lookup, you must pair INDEX and MATCH with the case-sensitive FIND function.

The Formula

=INDEX(return_range, MATCH(TRUE, ISNUMBER(FIND(lookup_value, lookup_range)), 0))

Note: Depending on your Excel version, you may need to press Ctrl + Shift + Enter to enter this as an array formula.

How It Works

  1. FIND(lookup_value, lookup_range) searches for the case-sensitive string inside every cell of the lookup range. It returns a number if found, or a #VALUE! error if not.
  2. ISNUMBER(...) converts those results into an array of TRUE and FALSE values.
  3. MATCH(TRUE, ..., 0) searches for the first TRUE in that array, matching the exact location of the case-sensitive substring.

Troubleshooting & Best Practices

  • Beware of Multiple Matches: Lookup formulas return the *first* match they find. If your search term is too short (e.g., searching for "Al" when you have "Alan" and "Albert"), Excel will stop at the first occurrence. Always make your lookup values as specific as possible.
  • Prevent #N/A Errors: Wrap your legacy formulas in IFERROR to keep your spreadsheets clean:
    =IFERROR(VLOOKUP("*" & D2 & "*", A2:B10, 2, FALSE), "Not Found")
  • Lookup Values with Literal Wildcards: If you are looking up values containing physical asterisks or question marks, ensure you use the tilde (~) character in your search string to escape them.

Conclusion

Mastering partial text lookups with wildcard characters transforms how you clean and reconcile data in Excel. For simple, right-facing lookups, VLOOKUP remains a quick and handy tool. For older versions of Excel requiring flexibility, the INDEX & MATCH combination reigns supreme. Finally, if you are working with modern Excel, XLOOKUP with its dedicated wildcard match mode offers the most elegant, powerful, and readable solution available. Choose the formula that best fits your environment and start parsing messy data like a pro!

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.