Function Problems

How to Count Excel Values Starting with 50 Using Wildcards

Nimra MalikNimra Malik Nov 10, 2026 868 views

Question details

The user needs to count cells containing values that begin with "50", but the wildcard formula is failing and counting literal asterisks instead.

How to Count Excel Values Starting with 50 Using Wildcards
Product
Excel
Device & OS
not provided
Scenario
Writing a counting function (like COUNTIF) using an asterisk wildcard to match values starting with a specific number pattern.
Observed behavior
Excel counts the literal asterisk symbol instead of treating it as a wildcard, typically because the target cells contain numeric data instead of text.
Before you start

Verify whether the column you are trying to count contains numbers formatted as text or actual numeric values. In Excel, wildcards like the asterisk (*) only function correctly when applied to text criteria.

Solution 1Recommended

Use COUNTIF with Wildcards for Text Values

Use the standard COUNTIF formula with an asterisk wildcard when your target data is formatted as text.

The asterisk (*) is a wildcard that matches any sequence of characters, but it only works when used with text criteria. If your cells are already stored as text, this is the most straightforward method.

1
Select the result cell

Click on an empty cell where you want the total count to be displayed.

2
Enter the COUNTIF formula

Type =COUNTIF(C:C, "50*") into the formula bar, replacing 'C:C' with your actual target range.

3
Calculate the result

Press Enter to execute the formula. Excel will count all text strings in the range that begin with '50'.

Data Type Warning: If your formula returns 0, the data is likely stored as numeric values. You will need to either convert the data to text or use the COUNTIFS numeric method below.

Easily Count and Analyze Data with WPS Spreadsheet

WPS Spreadsheet offers full support for wildcards and advanced statistical functions like COUNTIF and COUNTIFS. You can effortlessly count specific text patterns or numeric ranges using the exact same formulas as Microsoft Excel, completely free of charge.

  1. 1. Open your workbook: Launch WPS Spreadsheet and open the document containing your dataset.
  2. 2. Apply the COUNTIF formula: Click an empty cell and type =COUNTIF(A1:A100, "50*") to count text starting with 50.
  3. 3. View your results: Press Enter to instantly view your calculation results with perfect Excel formula compatibility.
100% compatible with Microsoft Excel formulas, wildcards, and data formatting.Seamlessly supports wildcard characters (* and ?) for complex text criteria counting.Lightweight, fast software with built-in tools to easily convert text and numeric data.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my COUNTIF asterisk wildcard return zero or count actual asterisks?

Asterisks only function as wildcards when applied to text strings. If your target cells contain numeric values, Excel cannot process the wildcard and instead searches for the literal asterisk character, often resulting in a count of zero.

How do I convert my numbers to text to make the wildcard work?

Select your column of numbers, go to the 'Data' tab, click 'Text to Columns', click 'Next' twice, and select 'Text' under Column data format. Once converted to text, your COUNTIF wildcard formula will work normally.

Can I use other wildcards with the COUNTIF function?

Yes. In addition to the asterisk (*) which matches any number of characters, you can use a question mark (?) to match any single character. If you need to find an actual literal question mark or asterisk, place a tilde (~) before it in your formula.