Go Back

Count cells equal to

Figure 1. of the Count Cells Equal To Function in Excel.

Let’s say we have a range of data values in our Excel sheet, and we want to count how many cells meet a specific criteria. This can be acheived through the COUNTIF function. This tutorial will step through the process of counting cells equal to a specific value.

Generic Formula


How to use the Excel COUNTIF Function.

The COUNTIF Function in Excel is fully automated. It is designed to automatically count the amount of cells within a range which matches with our specified criteria.

We can achieve this by following three simple steps;

  1. Arrange the total data values in our Excel sheet by column.

In our example illustrated below, we have 3 column – YEAR, PLAYER OF THE YEAR (which contain the year of the annual ceremony and the name of the players) and the RESULT column.

Figure 2. of Data Values in Excel.

  1. Input the following formula syntax into cell C6 of our worksheet;

=COUNTIF(B2:B15,"Roger Federer")

This will automatically count the number of times that particular player’s name occurs in our list of data values.

Figure 3. of the Count Cells Equal To Function in Excel.

Since the name “Roger Federer” occurs in five separate years in our list of data values, the Excel COUNTIF operation syntax returns the result as 5.

  1. Modify and Copy the formula syntax in cell C6 into the other cells in the RESULT column of our worksheet to achieve the desired results.

Figure 4. of the Count Cells Equal To Function in Excel.


  • For the range (in the formula syntax) in our example, we use B2:B15.
  • For the value (in the formula syntax) in our example, we use the player’s name.
  • When our data values are in the form of text, they must be enclosed in double quotes     ( “ “ ).

Figure 5. of Final Result.

Instant Connection to an Expert through our Excelchat Service

Our live Excelchat Service is here for you. We have Excel Experts available 24/7 to answer any Excel questions you may have. Guaranteed connection within 30 seconds and a customized solution for you 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 need a formula to count when numbers are not equal. I have 2 columns of cells, 20 rows high, I need to count how ,many times the rows don't match. Ex. row 1 If c4<>b4, count 1, if c5<>b5, count 1, if c6<>b6, count 1......So if in the 20 rows I have 5 rows that don't match, count 5.
Solved by G. E. in 23 mins
If cells A4 and A5 are equal then perform =SUM(D5+H4) If cells A4 and A5 are not equal then perform =SUM(D5+G5)
Solved by V. U. in 18 mins
I need help making a column of cells equal to one cell
Solved by A. C. in 11 mins

Leave a Comment