## Count specific characters in a range of cells

This tutorial introduces some formulas to count the number of times a specific character appears in a range in Excel. #### How to count number of specific characters in a range of cells in Excel?

Generic formula

=SUMPRODUCT(LEN(range)-LEN(SUBSTITUTE(range,character,"")))

Arguments

Range: The range of cells that you want to count specific character.

Character: The specific character you want to count. It can be:
1. The character enclosed in quotation marks;
2. Or a reference to a cell containing the character.

How to use this formula?

In this section, we are going to show you how to use this formula in Excel to count the number of times a character appears in a certain range in Excel.

Supposing you want to count the character “e” in range B5:B8, please do as follows.

Select a blank cell, copy the below formula into it to get the result immediately.

=SUMPRODUCT(LEN(B5:B8)-LEN(SUBSTITUTE(B5:B8,"e",""))) Notes:

• 1. Please change the range “B5:B8” and character “e” to your own needs;
• 2. If the character is not found in given range, it will return 0;
• 3. The formula is case-sensitive;
• 4. If you want to count specific character in a range and ignore the case, please use the UPPER function inside the SUBSTITUTE as the below formula shown:
=SUMPRODUCT(LEN(B5:B8)-LEN(SUBSTITUTE(UPPER(B5:B8),UPPER("e"),"")))
• How this formula works?

• 1. LEN(SUBSTITUTE(B5:B8,"e",""))): The SUBSTITUTE function removes the specific character “e” from the specified range B5:B8. And the LEN function calculates the string length for each cell without the specific character, then returns as an array of numbers. Here it will return {18;10;8;18};
• 2. LEN(B5:B8): This LEN function calculates the total string length for each cell in the given range, and return the lengths as an array of numbers. Here the LEN function will return {20;11;10;20};
• 3. SUMPRODUCT({20;11;10;20}-{18;10;8;18}): After subtracting, the final array should be {2;1;2;2}, and then the SUMPRODUCT function sums the numbers in the array and returns the total count of “e” in range B5:B8.

#### Related functions

Excel LEN function
The LEN function returns the number of characters in a text string.

Excel SUBSTITUTE function
The SUBSTITUTE function replaces text or characters within a text string with another text or characters.

Excel SUMPRODUCT function
The SUMPRODUCT function can be used to multiply two or more columns or arrays together, and then get the sum of products.

#### Related formulas

Count occurrences of specific characters in an Excel cell
This tutorial introduces how to apply formulas based on the LEN and SUSTITUTE functions to count the number of times a specific character appears in an Excel cell.

Count specific words in a cell in Excel

Count specific words in a range in Excel
This article explains a formula to count the number of times a specific word appears in a range of cells in Excel.

Count number of characters in a cell in Excel
The total characters not only includes all letters, but also all spaces, punctuation marks and symbols in the cell. Follow this tutorial to easily count the total characters in a cell with the LEN function in Excel.

Count number of characters in a range in Excel
This article explains a formula to count total characters that appear in a range of cells in Excel.

### The Best Office Productivity Tools

#### Kutools for Excel - Helps You To Stand Out From Crowd

 Popular Features: Find, Highlight or Identify Duplicates  |  Delete Blank Rows  |  Combine Columns or Cells without Losing Data  |  Round without Formula ... Super VLookup: Multiple Criteria  |  Multiple Value  |  Across Multi-Sheets  |  Fuzzy Lookup... Adv. Drop-down List: Easy Drop Down List  |  Dependent Drop Down List  |  Multi-select Drop Down List... Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Columns to Select Same & Different Cells ... Featured Features: Grid Focus  |  Design View  |  Big Formula Bar  |  Workbook & Sheet Manager | Resource Library (Auto Text)  |  Date Picker  |  Combine Worksheets  |  Encrypt/Decrypt Cells  |  Send Emails by List  |  Super Filter  |  Special Filter (filter bold/italic/strikethrough...) ... Top 15 Toolsets:  12 Text Tools (Add Text, Remove Characters ...)  |  50+ Chart Types (Gantt Chart ...)  |  40+ Practical Formulas (Calculate age based on birthday ...)  |  19 Insertion Tools (Insert QR Code, Insert Picture from Path ...)  |  12 Conversion Tools (Numbers to Words, Currency Conversion ...)  |  7 Merge & Split Tools (Advanced Combine Rows, Split Excel Cells ...)  |  ... and more

Kutools for Excel Boasts Over 300 Features, Ensuring That What You Need is Just A Click Away... #### Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)

• One second to switch between dozens of open documents!
• Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
• Increases your productivity by 50% when viewing and editing multiple documents.
• Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Edge and Firefox. 