Function Problems

Excel COUNTIF: Count Cells Containing Specific Letters

John WilsonJohn Wilson Nov 18, 2026 870 views

Question details

Count cells containing selected letters anywhere in their text.

How to Count Cells Containing Specific Letters in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
The user wants to count text cells containing letters such as s, a, or f.
Observed behavior
The desired result is a count of cells containing each selected letter, or a count of cells containing any of the selected letters.
Before you start

Identify the range to search and decide whether you need a separate count for each letter or one combined count. In the examples below, the text is in A3:A9.

Solution 1Recommended

Use COUNTIF wildcards to count each letter

Use this method to get a separate count for each selected letter, regardless of where it appears in a cell.

1
Enter the target letters

Enter s in B2, a in C2, and f in D2. Keep the text to search in A3:A9.

2
Enter the formula

Select B3 and enter =COUNTIF($A$3:$A$9,"*"&B$2&"*"). The asterisks match text before and after the letter in B2.

3
Copy across

Drag the fill handle from B3 across to D3. Each formula counts cells containing the letter in the header above it.

Use COUNTIF wildcards to count each letter
Separate counts can overlap: A cell containing more than one selected letter appears in more than one count. Do not add these counts if you need to count each matching cell only once.
Count letters in WPS Spreadsheets

Count cells containing letters in WPS Spreadsheets

Use COUNTIF and wildcard characters in WPS Spreadsheets to count cells containing a selected letter anywhere in their text.

  1. 1. Open your spreadsheet: Open WPS Spreadsheets and use Open to select your workbook.
  2. 2. Add target letters: Enter the letters to count in B2, C2, and D2, with the text to search in A3:A9.
  3. 3. Enter COUNTIF: Select B3 and enter =COUNTIF($A$3:$A$9,"*"&B$2&"*"). Press Enter.
  4. 4. Count the other letters: Drag the fill handle from B3 across to D3 to calculate a separate count for each letter.
Count matching cells with a familiar COUNTIF formulaOpen and edit Microsoft Excel XLSX and XLS filesCopy formulas across columns for multiple lettersWork in a familiar spreadsheet interface
microsoft office alternative - wps office

Frequently Asked Questions

Does COUNTIF distinguish between uppercase and lowercase letters?

No. COUNTIF is not case-sensitive, so a search for s also matches S.

Why does the formula use an asterisk on each side of the letter?

In =COUNTIF(A3:A9,"*s*"), each asterisk matches any number of characters. This allows s to appear at the beginning, middle, or end of the cell text.

Can I add the counts for s, a, and f to get one total?

Adding the separate COUNTIF results can count a cell more than once if it contains multiple target letters. Use the SUMPRODUCT and SEARCH formula above to count each matching cell once.

How do I search a different range?

Replace $A$3:$A$9 in the COUNTIF formula with your range, such as $C$2:$C$100. Keep the dollar signs if you want the range to stay fixed when copying the formula.