Count Excel Cells That Begin with a Literal Asterisk Using COUNTIF
Question details
Count cells whose text begins with a literal asterisk using COUNTIF.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet uses an asterisk at the beginning of some names as a category marker.
- Observed behavior
- A criterion such as "*Jones" treats the asterisk as a wildcard and matches values ending in Jones, even if they do not begin with a literal asterisk.
Identify the range containing the names and check whether you need to count every value starting with an asterisk or only an exact value such as *Jones.
Escape the Asterisk in the Excel COUNTIF Criterion
Use a tilde before the asterisk to count it as a literal character rather than a wildcard.
In Excel, click an empty cell where you want the count to appear.
Enter =COUNTIF(A2:A100,"~**") and press Enter. Replace A2:A100 with your data range. The first asterisk is escaped by ~; the second matches any following text.
To count cells containing exactly *Jones, enter =COUNTIF(A2:A100,"~*Jones") in the result cell and press Enter.

Count Literal Asterisks in WPS Spreadsheets
Use the same escaped COUNTIF criteria in WPS Spreadsheets to count text that starts with an asterisk or matches a specific marked name.
- 1. Open the spreadsheet: Open WPS Spreadsheets, select Open, and choose your workbook.
- 2. Select an empty cell: Click the cell where you want to display the count.
- 3. Enter the formula: Type =COUNTIF(A2:A100,"~**") to count cells starting with a literal asterisk, replacing the range with your own.
- 4. Calculate the result: Press Enter to display the count. For an exact match such as *Jones, use =COUNTIF(A2:A100,"~*Jones") instead.

Frequently Asked Questions
Why does COUNTIF count Jones when I use "*Jones"?
In a COUNTIF criterion, * matches any number of characters, including zero. Use "~*Jones" to match the literal text *Jones.
How do I count every cell that starts with an asterisk?
Enter =COUNTIF(A2:A100,"~**") in an empty cell, replacing A2:A100 with your range. The tilde makes the first asterisk literal, while the second matches any following text.
Can I use a different character as a category marker?
Yes. If you can choose the marker, consider | or ! instead. Avoid ? because it is also a COUNTIF wildcard, and be cautious with leading =, +, or -, which may be interpreted as formula operators.
Will the escaped COUNTIF formula work in WPS Spreadsheets?
Yes. Open the workbook in WPS Spreadsheets and enter a formula such as =COUNTIF(A2:A100,"~*Jones") in an empty cell.




