In Excel for Microsoft 365 on Windows, text-filter wildcards let you match patterns: use * for any number of characters, ? for exactly one character, and ~ before a wildcard to match it literally. Open the column’s filter menu, choose Text Filters, then use a text condition or Custom Filter to enter a pattern such as *east* for text containing “east.”
What Excel filter wildcards do
A wildcard stands in for characters in a text-matching condition. Rather than listing every possible value, you can give Excel a pattern and filter for cells whose text fits it. This is useful when a column contains many variations, such as city names with different prefixes or product descriptions with changing model numbers.
Excel’s AutoFilter supports three wildcard characters in text criteria:
*represents any number of characters. For example,North*matches text beginning with “North,” including “North,” “Northern” and “North District.”?represents one character. The patternQ?7matches “QA7” or “Q17,” but not “Q7” or “QAB7.”~escapes the next wildcard character so Excel treats it as ordinary text. Use~*to look for a literal asterisk,~?for a question mark and~~for a tilde.
These symbols are for matching text patterns in a filter criterion. They do not change the values in your worksheet or add characters to the cells. A filter only hides rows that do not meet the condition; clearing the filter shows them again.
How to apply a wildcard text filter
Start with a dataset that has a header row and a column containing text. If it is an Excel table, its filter arrows are usually already visible. For a regular range, click a cell in the data and select Data > Filter on the ribbon. On Windows, Ctrl+Shift+L toggles AutoFilter for the selected range; on Mac, use the ribbon’s Data > Filter command if the shortcut differs in your setup.
- Select the dropdown arrow in the header of the column you want to filter.
- Point to or open Text Filters, then choose a condition such as Contains, Begins With or Ends With. To enter a wildcard pattern directly, choose Custom Filter.
- Enter the text or pattern in the condition field. For example, use
*east*to find values with “east” anywhere in the text. - If you set a second condition, choose whether the row must meet both conditions (And) or either one (Or), then confirm the filter.
The exact menu presentation can differ slightly by platform or window size. In Excel for Mac and Excel for the web, use the column’s filter dropdown and look for the text-filter conditions; the wildcard meanings are the same. The ribbon route for turning filtering on is Data > Filter.
Common patterns and examples
Suppose a Department column contains “East Sales,” “Sales East,” “Northeast Support” and “West Sales.” The pattern *east* finds the first three because “east” occurs somewhere in each value, while East* finds only values that start with those letters. The text condition is not case-sensitive, so capitalization alone does not separate matches.
Sam*matches text that starts with “Sam,” such as “Sam Lee” or “Sample.”*reportmatches text that ends with “report,” such as “Monthly report.”*box*matches text with “box” anywhere, including “Box Set” and “Toolbox.”AB?4matches a four-character pattern beginning with “AB” and ending with “4,” with one character in between.INV-??matches “INV-” followed by exactly two characters, such as “INV-08.”
Wildcards do not mean “one or more” in the same way a regular expression might. An asterisk represents a sequence of zero or more characters in a pattern, while a question mark represents one character. Excel AutoFilter is not a regular-expression search: it does not support regex operators such as character classes or a plus sign meaning “repeat.”
Choosing Contains, Begins With, or a custom pattern
For a simple task, the built-in text conditions are often clearer than typing symbols. Choose Contains when the same word or phrase may occur anywhere in the cell, Begins With for a prefix, and Ends With for a suffix. These options let you enter the text itself without constructing the corresponding asterisk pattern.
Use a custom wildcard pattern when position or character count matters. For instance, a search for entries starting with “AB” and ending with “4” could use a pattern equivalent to AB*4. A pattern like AB?4 is narrower because it requires exactly one character between the prefix and final digit. If the goal is simply to find a phrase anywhere, the built-in Contains condition is less error-prone than adding asterisks manually.
Custom Filter also allows two conditions on one column. Choose And when a value must satisfy both conditions, such as beginning with “A” and ending in “9.” Choose Or when either condition is enough, such as beginning with “A” or beginning with “B.” Be careful: combining a broad wildcard with an Or condition can return more rows than expected.
Literal asterisks, question marks, and tildes
A common surprise is that a symbol visible in the cell may be treated as a wildcard rather than as punctuation. If product codes actually contain an asterisk, do not enter a bare asterisk to search for that symbol: it means “any sequence.” Put a tilde immediately before the symbol in the criterion. For example, Code~*7 looks for text beginning with “Code,” followed by a literal asterisk, and ending in “7.”
The same escaping rule applies to a literal question mark. The pattern Ref~?A searches for the characters “Ref?A,” rather than allowing any one character after “Ref.” To search for a literal tilde, double it in the pattern, as in ~~. If a pattern contains both a wildcard and a literal wildcard symbol, escape only the symbol meant literally.
Check the actual cell contents before assuming a symbol is present. A displayed asterisk might be part of the value, or it might come from formatting, a formula result, or a neighboring character that is easy to miss. The filter matches the underlying text value, not the visual appearance of a cell’s formatting.
Why a wildcard filter may return unexpected rows
First, verify that the condition is being applied to the intended column and that the whole data range is included. A blank row inside an ordinary range can interrupt what Excel recognizes as a contiguous data area, and data placed outside the filtered range will not respond to that filter. Converting the range to a table with Insert > Table can help keep related rows and columns together as the data grows.
Next, inspect the text itself. Leading or trailing spaces, nonbreaking spaces copied from a webpage, and spelling differences can make a value look like a match while preventing the pattern you chose from matching as expected. For example, a cell may begin with a space before “East”; East* expects the first character to be “E,” but *East* allows preceding characters. A wildcard can help find text in a different position, but it does not remove unwanted spaces from the underlying values.
Also check whether the values are really text. A column containing numbers or dates may offer number or date filter conditions instead of text conditions. If identifiers contain leading zeros, confirm they are stored as text when those zeros are significant; a numeric value formatted to display zeros is not necessarily the same underlying text as an ID with literal zeros. Finally, remember that Excel text filtering is case-insensitive: a wildcard filter will not isolate “East” from “east” based on capitalization alone.
Filter dropdown search versus Text Filters
The dropdown’s checklist search field and the Text Filters commands serve different purposes. The checklist search helps narrow the displayed list of distinct values so you can select specific items. Text conditions are the more direct choice when you want to describe a pattern such as “contains this phrase” or enter a custom wildcard criterion. If you need a repeatable pattern-based filter, use the text-filter commands rather than relying on a checklist selection.
Filtering can also be combined across columns. For example, filter Region for values matching *east*, then filter Status to show only “Open.” Excel applies both column filters together, so a visible row must meet the active conditions in both columns. To broaden results, clear or change a column’s condition rather than assuming that a second filter will replace the first.
When a different tool is a better fit
AutoFilter is convenient for interactive review and temporary row hiding. If you need a list of matching records in a separate location, a formula-based approach may be more suitable, but wildcard support depends on the function. For example, the worksheet function FILTER returns rows based on a Boolean include condition; it does not accept AutoFilter wildcard criteria as a general pattern argument. Excel 2021 and Microsoft 365 include FILTER, but the matching logic still has to be constructed for the particular data and requirement.
For repeatable cleanup, consider correcting inconsistent spaces or characters in the source data rather than using increasingly broad patterns. For complex pattern rules, Power Query or a carefully designed formula may be a better fit than AutoFilter. The right option depends on whether you need an interactive view, a refreshed output list, or standardized data. Wildcards are useful for straightforward text patterns, but they are not a substitute for a full regular-expression engine.
Frequently Asked Questions
What wildcard means “contains” in an Excel text filter?
Place an asterisk on both sides of the text, such as *blue*, to match text with “blue” anywhere in the value. You can also select Text Filters > Contains and enter “blue.”
How do I filter cells that start with certain letters?
Use a pattern such as INV* in a custom text filter, or choose Text Filters > Begins With and enter INV. The asterisk allows any following characters.
How do I match exactly one unknown character?
Use a question mark in the pattern. For example, R?D matches “RAD” and “R2D,” but it does not match “RD” or “ROAD.”
How can I search for an actual asterisk in a cell?
Put a tilde before it in the filter criterion: ~*. The tilde tells Excel to treat the asterisk as a literal character rather than as a wildcard.
Are Excel text-filter wildcards case-sensitive?
No. Standard AutoFilter text conditions do not distinguish uppercase from lowercase. If case-sensitive matching is essential, use a different method designed to test case as well as text content.
Can I use wildcards in number or date filters?
Wildcards are intended for text criteria. For numeric values and dates, use the available number or date conditions, or ensure identifiers that should be treated as text are stored as text.
Related
- Excel Shortcut Keys to Select a Column: Quick Guide
- Excel Shortcut to Select an Entire Column on Windows
- Excel Shortcut to Insert an Entire Row
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- Excel Time Plus Minutes: Formulas and FixesTo add minutes to an Excel time, add the minutes divided by 1,440: with a time in A2…
- Excel Days Until End of Month: Formula and ExamplesWith no input cells needed, enter =EOMONTH(TODAY(),0)-TODAY() to calculate the number of days from today to the last…
- How to Remove Spaces in Excel With TRIM and SUBSTITUTETo clean extra spaces in Excel, use TRIM; to delete every ordinary space, use SUBSTITUTE. With the original…
- Switch Excel Formulas to Values: Methods and TipsTo switch formulas to fixed values in Excel for Microsoft 365 on Windows, select the formula cells, press…
- Excel Filter Shortcut: How to Turn Filters On and OffIn Excel for Microsoft 365 on Windows, press Ctrl+Shift+L to turn AutoFilter on or off for a data…
- Excel Dependent Drop-Down List with VLOOKUP ExplainedYes—you can use a dependent drop-down list with VLOOKUP, but they do different jobs. Data Validation creates the…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.