Vous êtes sur la page 1sur 2

Using Wildcards in Excel

Wildcard characters can be used to carry out partial matching on a text string. Wildcard
characters can be used in formulas, conditional formatting, filtering, and Excels search and
replace feature.
The basic wildcard structure
There are three wildcard characters in excel as follows.

Wildcard
Description
Character

Asterisk (*) The asterisk character can take the place of several.
For instance, if you search for low* this matches lower, lowered, lowering,
and lowers.

Question The question mark character can take the place of a single.
Mark (?) For instance, if you search for b?g this matches big , bit , and bug.

Tilde (~) The tilde character cancels out/nullifies the other wildcard characters. It tells
Excel that the following character should be treated as a normal character and
not a wildcard. This is useful if you want to actually search for those wildcard
characters.
For example, "Tr~?y" matches only with "Tr?y", not "Tray" or "Troy".

In summary, we use the question mark (?) when to accept only a single character, and the
asterisk (*) to accept multiple characters.

Condition to use wildcards


We can use wildcards in any situation in which we 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 or FIND functions;
 When performing a VLOOKUP or HLOOKUP; and
 When using INDEX, MATCH.
Wildcards can be extremely helpful to match or search against a partial phrase rather than an
entire string.
Some examples of Wildcard
In formula:
= SEARCH("c*b", "Abracadabra")
Output: 5
The above returns the number 5, because "c*b" matches the phrase "cadab", which is found
five characters in to the given string.
In Conditional Formatting:
For conditional formatting we can use formula. The formula should be a logical formula and
result should be in TRUE or FALSE. If that formula returns TRUE, conditional formatting will
apply. And, if it returns FALSE, conditional formatting will not apply.
To Add Formulas In Conditional Formatting:
 Go to Home Tab -> Styles -> Conditional Formatting -> New Rule.
 Select “Use a formula to determine which cell to format” in select a rule type section
from new pup-up window.
 Now formula can be inserted in formula input bar and select formatting to apply using
format button.

Vous aimerez peut-être aussi