In Microsoft Excel, a wildcard is a great tool used in searches, filtering, and data manipulation tasks. They allow users to represent one or more characters when searching for specific patterns within text or data. In this article, you will learn how to use a wildcard in Excel.
Key Takeaways:
Table of Contents
Introduction to Wildcard
What is a Wildcard?
A wildcard in Excel is a special character that represents one or more characters in a text string. Wildcards make it easier to search, filter, count, or match data when you do not know the exact text or when only part of the text is available.
Wildcards are commonly used with functions such as XLOOKUP, VLOOKUP, COUNTIF, COUNTIFS, SUMIF, SUMIFS, SEARCH, and FILTER to perform flexible text matching. They are especially useful when working with large datasets that contain similar names, codes, or descriptions.
Types of Wildcards
The three primary wildcards used in Excel:
- Asterisk (
*) – It is used to match any number of characters. - Question mark (
?) – It is used to match exactly one character. - Tilde (
~) – It treats*,?, or~as regular characters instead of wildcards.
How to use Wildcards in Excel
Find and Replace
Find and Replace feature allows you to search for specific text and replace it. Wildcards allow you to search for a text pattern, and it is useful when some characters are unknown.
You can use the * sign before 2023 to search for all sentences that end with 2023.
Functions
Excel functions such as COUNTIF, SUMIF and AVERAGEIF support wildcards. You can use these characters to perform calculations based on specific criteria. These functions can be used to count, sum or average values based on partial searches instead of exact match.
This formula sums values in column B where the corresponding cell in column A ends with “2023”.
Filters
Excel’s filtering options allow you to display only the data that meets specific criteria. Wildcards in filters enable you to precisely filter data based on patterns rather than exact matches.
Filters rows that end with “2023”.
Solving Common Wildcard Puzzles
- Check your data for extra spaces that may prevent a match.
- Remove hidden or non-printable characters if the results are incorrect.
- Make sure the Excel function you are using supports wildcards.
- Combine wildcards with the
&operator to create flexible search criteria. - Test your formula with a simple example to confirm it works correctly.
- Use functions like
COUNTIFSorSUMIFSto verify that your wildcard criteria return the expected results. - Review your spelling and data format if the formula does not return the expected output.
FAQs
Why do we use wildcards in Excel?
We use wildcards in Excel to search, filter, and manipulate data with flexible criteria. They are used for partial matches or when the complete data entry isn’t known. It is great for tasks like finding a string within a larger text or creating dynamic formulas that adjust to varying content.
How to use Wildcard Characters in Excel Formulas?
In Excel formulas, you can use wildcards for searching and filtering unknown characters. To count instances that end with example followed by any number of characters:
=COUNTIF(A1:A10, "*example?")
Why Aren’t My Excel Wildcards Working Correctly?
If Excel wildcards aren’t working, ensure you’re using the correct one (*, ?, ~) for the task. Check that they are not misinterpreted as literal characters—use a tilde (~) before a wildcard if so. Also, confirm the function you’re using supports wildcards, and look out for any hidden errors in your formulas.
What is an example of a wildcard search?
An example of a wildcard search in Excel is using =SEARCH("a?to*e", A1) to find any occurrences in cell A1 that start with ‘a’, followed by any character, then ‘to’, followed by any number of characters, ending with ‘e’, like ‘autozone’ or ‘agitate’.
What is the wildcard match formula in Excel?
The wildcard match formula in Excel often involves the MATCH function with wildcards, like =MATCH("*criteria*", range, 0). This will return the position of the first cell in the range that contains the word ‘criteria’ anywhere in the cell. Use “*” for any sequence of characters, and “?” for a single character.
John Michaloudis is a former accountant and finance analyst at General Electric, a Microsoft MVP since 2020, an Amazon #1 bestselling author of 4 Microsoft Excel books and teacher of Microsoft Excel & Office over at his flagship MyExcelOnline Academy Online Course.


