DEV Community

Deepak for Aaw Excel

Posted on • Originally published at aawexcel.com on

1

Formula to Count Occurrences of a Character in a String in Excel!

Sometimes, we want to find the occurrences of a specific character in a word. Instead of counting it manually, we can use the Excel COUNTCHAR function. In this article, we will guide you to know the simple and useful functions of Excel. This page will describe the Formula to Count the Occurrences of a Character in a String with its suitable example. Get an official version of MS Excel from the following link:

https://www.microsoft.com/en-in/microsoft-365/excel

Count occurrences of a character
Count occurrences of a character

General Formula

Here we come up with a simple formula to find the total occurrences of a character in a string in the specified cell.

=COUNTCHAR(input value,”character”)

Syntax Explanations

  • COUNTCHAR Function – This function returns the total occurrences of a specified character in the selected value.
  • Input value – It represents the input values from the given worksheets.
  • Character – A character that we need to count the occurrences of.
  • Comma symbol (,) – It is a separator that helps to separate a list of values.
  • Parenthesis () – The main purpose of this symbol is to group the elements.

How to Apply Formula to Count Occurrences of a Character?

In order to find the total occurrences of a character in a specific value in Excel, we can use an Excel formula. This formula can make use of the COUNTCHAR function of Excel. As we said earlier, the COUNTCHAR function returns the total occurrences of a specific character.

For instance, we have given a word “ Excel ” and we want to find the occurrences of the character “ e ” from it. You need to know that the COUNTCHAR function is case-sensitive.

Input String
Input String

Use the below-mentioned formula in any cell where you want to get the output result.

=COUNTCHAR(B2,”e”)

Enter the formula
Enter the formula

Once you have entered the formula, *click * on the *Enter * button to execute it and get the result.

Output
Output

If the above-given scenario is not enough to understand this formula and want to learn this with a simple example, kindly move to the following section.

Alternate Example

Here we come up with a simple example to know how to apply this Excel formula in the spreadsheet.

  • In the below screenshot, we have given a set of names and we want to find the occurrences of the character “ a ” from each name.

Input values
Input values

  • Apply the below-given formula to get the result on your spreadsheet.

=COUNTCHAR(B2,”a”)

Type the formula
Type the formula

  • You have to *press * the *Enter * button to get the result.

Result
Result

  • In order to fill the remaining cells, you will have to drag down the first output cell, it will auto-fill the remaining cells as shown in the below image.

Drag down the cell
Drag down the cell

Summary

From this article, we explained the information on the function and formula used to count the occurrences of a character from a string in Excel. Kindly, drop your feedback in the below comment section. Thank you so much for Visiting Our Site!! Continue learning on AawExcel!

Video Tutorial

The below-given video will show how to apply an Excel formula to count the occurrences of a character from a string in Excel.

Read Also:

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →