Using Excel's wildcard character
At times, you may want to use certain string matching or search functions — like
Think of Excel's wildcard characters like the jokers in a deck of cards. They can take on any value they want to.
Here's some more information on how wildcards work:
The basic wildcard structure
There are two key types of wildcards in Excel. Here's what they look like and how you use them.
Wildcard | Name | Explanation |
---|---|---|
? | Question mark | Takes the place of a single character. For example, "Tr?y" matches with "Tray", "Troy", and "Trey", but not "Trolley" |
* | Asterisk | Can take the place of any number of characters. For example, "Tr*y" matches with "Tray", "Troy", and "Trolley". |
~ | Tilda | Tells Excel that the following character should be treated as a normal character and not a wildcard. For example, "Tr~?y" matches only with "Tr?y", not "Tray" or "Troy". |
Per the chart above, use the question mark (
Here are a few examples of wildcards in action with the
=SEARCH ("c?d" ,"Abracadabra" )
Output:5
The above returns the number
=SEARCH ("c*b" ,"Abracadabra" )
Output:5
The above returns the number
=SEARCH ("c?b" ,"Abracadabra" )
Output:#VALUE!
The above returns a
When can I use wildcards?
You can use wildcards in any situation in which you are matching one string against another. There are many such uses, but here are some of the most common:
- When searching for a string using the
SEARCH orFIND functions; - When performing a
VLOOKUP orHLOOKUP ; and - When using
INDEX MATCH .
Wildcards can be extremely helpful if you want to match or search against a partial phrase rather than an entire string.
Save an hour of work a day with these 5 advanced Excel tricks
Work smarter, not harder. Sign up for our 5-day mini-course to receive must-learn lessons on getting Excel to do your work for you.
- How to create beautiful table formatting instantly...
- Why to rethink the way you do VLOOKUPs...
- Plus, we'll reveal why you shouldn't use PivotTables and what to use instead...