< Go Back

Count cells equal to

The function COUNTIF can be used to count the number of cells that are equal to a specific value.  The figure below explains how to use the COUNTIF function to count the number of cells that fit a certain criteria.

Formula

The general syntax of the COUNTIF function is as follows:

=COUNTIF (range, value)

  • Range is the group of cells that you want to test against your value criteria.
  • Value contains the value to count in range argument  

Explanation

According to figure 1, the cell G7 contains the formula:

=COUNTIF(D6:D12,“Blue”)

The Excel COUNTIF function counts the number of cells that match the supplied criteria. For this example, we are using the range of D6:D12 and counting the number of cells which contain the string “Blue”.

COUNTIF will return the count of all the values equal to “Blue”. One major thing to be noted here is that when any text value is applied, it needs to be enclosed in double quotes (“”).

Example

In this example, color names are given in cell range D6:D12 and you need to count the cells which contain “Blue” using the COUNTIF function.

Figure 1: COUNTIF Function

Our customers love us!
“The expert was absolutely amazing and stuck with me the whole way through. They were polite, patient, seemed to want to genuinely help me and provided a solution that I would never have managed otherwise. I could not be more thankful for their support and solution. Thank you!” - - Chris T, in California
This blog is one way to figure it out. A 20 minute chat session with an expert is a better way.Get step-by-step guidance on your question

Leave a Comment

avatar