Usage of the asterisk (*) in Excel functions: wildcard search and summation
Explain the meaning of the asterisk (*) as a wildcard in Excel functions, distinguishing it from the multiplication operator, and illustrate how to perform fuzzy matching, summation, and counting using examples such as COUNTIF, SUMIF, and VLOOKUP, with troubleshooting for common errors included.
When counting how many entries in Excel start with"Zhang,"or summarizing sales by the term"mobile phone,"many people first think of using filters. However, when dealing with large datasets, formulas can be more efficient than filtering. At this point, a question arises: what exactly does the asterisk () mean in a formula? In A1B1, it denotes multiplication, but within the COUNTIF function’s criteria, it seems to"stand in"for other characters.
This article is for readers who frequently use COUNTIF, SUMIF, and VLOOKUP for statistical analysis and lookups but are still unclear about the two different meanings of the asterisk (). After reading it, you’ll be able to determine when to use as a wildcard, how to construct criteria that match at the beginning, contain, or end of a string, and which common pitfalls to watch out for.
What does * mean inside a function? One-sentence answer
In the criteria arguments of statistical and lookup functions, is a wildcard that represents any number of any characters (including zero); in formulas, is the multiplication operator. Which meaning applies depends on its position, not on Excel’s random selection.
| Your situation | Recommended Practice | Reason |
|---|---|---|
| Find content that starts with a specific word | Write the condition as "keyword*" | * represents any character after it, matching only the beginning part |
| To find content containing a specific word | Write the condition as "keyword" | One * before and after; the word in the middle will match regardless of its position. |
| Only want to match a fixed number of characters | Use a question mark ? to replace a single character, such as "???". | ? represents only a single character, and its range differs from that of *. |
| To find the literal asterisk character | Write as "~*" | The tilde turns the following * into a literal character. |
| To calculate the product of two numbers | Use A1*B1 directly | In the expression, * denotes multiplication and is not subject to wildcard matching. |
How Wildcards Work
Wildcards appear only in"criteria"-type arguments, such as the second argument of COUNTIF, the condition in SUMIF, or the lookup value in VLOOKUP. Excel replaces the * in the criteria with"any string"and then compares it to each cell one by one.
Three Common Ways of Writing
Suppose column A contains customer names and column B contains order amounts; you can write it like this:
- Count the number of people with the surname "Zhang":
=COUNTIF(A:A,"张"), where means that any characters can follow "Zhang," including nothing at all. - Sum the order amounts for records whose names contain "Company":
=SUMIF(A:A,"公司",B:B); the * on both ends ensures that any occurrence of "Company" in any position will be matched. - Count the number of people whose names consist of three characters:
=COUNTIF(A:A,"???"); each ? represents exactly one character, making it suitable for fixed-length data.
COUNTIFS and SUMIFS allow you to set multiple criteria at once, with each criterion supporting wildcards; for example, you can specify both"Zhang*"and that the amount column exceeds a certain value.
Points That Are Easy to Confuse
First, wildcards only work with text. If the numbers in column A are stored as numbers—even if they appear as text—the asterisk (*) in COUNTIF may not match them. When you get a zero result, first check whether the cell contains a numeric value or text.
Second, writing a single asterisk ()—that is, using the condition""—represents"all non-empty text."It does not count cells containing only numbers, nor does it count truly blank cells. If you need to count non-empty cells, you should use specialized functions such as COUNTA.
Third, the asterisk () is also a wildcard in the Find and Replace dialog box, but its role there is similar to that of a condition in a formula, so the concepts are analogous. However, in a directly entered formula, represents multiplication, so you cannot expect it to perform fuzzy matching.
Performing Fuzzy Lookup with VLOOKUP
The lookup value in VLOOKUP can also use wildcards. For example, to find records in a table whose names contain the content of cell E2, you can write:
=VLOOKUP(""&E2&"",A:C,2,FALSE)
Here, the & operator concatenates * and the contents of E2. Setting the fourth argument to FALSE specifies an exact-match mode, at which point wildcards take effect. If multiple results are found, VLOOKUP returns only the first one; to list all results, use the filter feature instead.
📊 Core Comparison
| symbol | Meaning | Common locations | Example |
|---|---|---|---|
| * | Any number of characters | Criteria for COUNTIF, SUMIF, and VLOOKUP | "Zhang*" |
| ? | Single character | Ibid. | "???" |
| ~ | Escaping indicates that the following symbol is a literal character. | Find the real * or ? | "~*" |
| * | multiplication sign | Standard expression | =A1*B1 |
This table is useful for cross-checking before writing a formula. If the formula result is incorrect, first check whether * is included in the criteria, then verify if it needs to be escaped with ~.
How to Use It in Practice
If your data comes from a PDF table, you can first export the table to Excel using the PDF editor in the OmniDoc desktop client, then follow the steps below:
- Open the exported Excel file, identify the column containing names or keywords, and verify whether the data is stored as text or numbers.
- In a blank cell, enter COUNTIF or SUMIF; select that column as the criteria range, and include in the criteria, for example, "company*".
- Press Enter, then randomly check a few rows of data to confirm that the results match those obtained by manual searching.
- If the results are too low, check for numbers stored as text, extra spaces at the beginning or end, or full-width characters inadvertently included in the keywords.
If you need to translate the table contents into another language before compiling statistics, you can upload the file to omnidoc.top, select either a bilingual side-by-side view or just the translation, download it, and then perform the aggregation. Machine translation may contain inaccuracies, so important elements such as names and numbers should be verified against the original text.
🎯 Which approach is right for you?
- If you just want to find the position of a specific word, using the filter or find function is sufficient; there’s no need to write a formula.
- If you need to perform repeated counts across multiple sheets, it’s best to use COUNTIF or SUMIF with wildcards, so the results update automatically as the data changes.
- If your keyword itself contains * or ?, remember to add a ~ before it; otherwise, the results may not match what you expect.
❓ Frequently Asked Questions (FAQ)
1. What is the difference between * and the multiplication sign in formulas?
In criteria arguments, stands for any characters; for example, "Zhang" matches content that begins with Zhang. In formulas, is the multiplication operator; for example, A1B1 calculates the product of two numbers. Because their contexts differ, Excel interprets them differently.
2. COUNTIF isn’t counting numbers—could it be that the wildcards aren’t working?
Wildcards only work with text. If numbers are stored as text, or if the number’s format doesn’t match the condition, the match may fail. First check the cell type, then consider whether a conversion is needed.
3. How do you find the actual asterisk in a text?
Add a tilde before the asterisk, writing it as "~*". This way, Excel will treat it as a literal character rather than a wildcard.
4. Why does VLOOKUP return an error when using wildcards?
A common cause is that the fourth argument is not set to FALSE, or the lookup value does not use & to concatenate *. After confirming that the formula syntax is correct, check whether the corresponding content exists in the source table.
5. Do the results of wildcards need to be verified?
Required. Statistics and search results are highly sensitive to data formats, spaces, and symbols; it is recommended to randomly sample a few rows and compare them with the original table, especially when dealing with financial or contractual data.
📝 Summary
In Excel functions, the asterisk () serves as a wildcard in criteria arguments and as a multiplication operator in formulas; the key to distinguishing between the two is their position. By mastering the three patterns"keyword,""keyword,"and ~, you can handle most scenarios involving matching strings that start with, contain, or search for an asterisk. If the results are incorrect, first check whether the data is stored as text or numbers.


