Go Back

Count Specific Characters in a Range in Excel

Excel allows users to perform various tasks working with characters. We can count specific characters in range using SUMPRODUCT, SUBSTITUTE, and LEN functions. In this tutorial, we will learn how to count specific characters in a range in Excel.

Figure 1. Example of how to Count Specific Characters in a range

Generic Formula



Here, the SUBSTITUTE function removes all occurrences of the character to be counted. The LEN function counts the length of the text without the character to be counted. The previous value is subtracted from this length.

The SUMPRODUCT creates an array with one item per cell in the range. Each item contains a number from the above calculation. Next, SUMPRODUCT sums these numbers. Finally, it returns a total which represents the count of the character.

Setting up Data

The following data contains some sample text. Column A contains these texts. Column B has the number of times “e” exist in these texts.

Figure 2. The Sample Data

To count the total number of times ‘e’ exists in these texts, we need to:

  • Go to cell B7. Click on it with the mouse.
  • Assign the formula =SUMPRODUCT(LEN(A2:A6)-LEN(SUBSTITUTE(A2:A6,"g",""))) to B7.
  • Press Enter.

Figure 3. Applying the Formula

This will show the number of times column A contains the character ‘e’, which is 8.


SUBSTITUTE is case-sensitive. It matches case performing a substitution. To count both lower and upper case occurrences, we need to nest the UPPER inside SUBSTITUTE. This will convert the text to uppercase. This, in turn will provide an uppercase character to count.

Most of the time, the problem you will need to solve will be more complex than a simple application of a formula or function. If you want to save hours of research and frustration, try our live Excelchat service! Our Excel Experts are available 24/7 to answer any Excel question you may have. We guarantee a connection within 30 seconds and a customized solution within 20 minutes.

Did this post not answer your question? Get a solution from connecting with the expert.

Another blog reader asked this question today on Excelchat:
Here are some problems that our users have asked and received explanations on

I want to find specific characters or string of characters within a spreadsheet, count how many appear, and tally the result in some cells.
Solved by V. D. in 26 mins
Need to count a Specific text for specific name in a range
Solved by V. B. in 11 mins
I want Excel to count a range of cells that contain specific data
Solved by B. L. in 13 mins

Leave a Comment