Exceljet

Quick, clean, and to the point

Count cells equal to

Excel formula: Count cells equal to
Generic formula 
=COUNTIF(range,value)
Explanation 

To count the number of cells equal to a specific values, you can use the COUNTIF function.

In the example shown, G6 contains this formula:

=COUNTIF(D5:D11,"red")

How this formula works

The COUNTIF function is fully automatic — it counts the number of cells in a range that match the supplied criteria.

For range, we use D5:D11, which contains colors. For criteria, we simply use "red".

COUNTIF returns the count of values in D5:D11 that are equal to "red".

Note: when text values are supplied directly as criteria, they need to be enclosed double quotes (""). If you have a criteria in another cell, you can supply the cell address as criteria without quotes, as seen in this example.

Author 
Dave Bruns

Excel Formula Training

Formulas are the key to getting work done in Excel. In this accelerated video course, you'll learn how to use formulas to manipulate text, work with dates and times, lookup values with VLOOKUP and INDEX & MATCH, count and sum with criteria, dynamically rank values, and create dynamic ranges. You'll also learn powerful skills to troubleshoot, trace errors, and fix problems. This is the formula training you should have had to begin with. See details here.

I love to use excel and use it a lot in my work. Your tips, tricks and examples have helped me enormously. - Lisa
Excel foundational video course
Excel Pivot Table video training course
Excel conditional formatting video course
Excel formulas and functions video training course
Excel Shortcuts Video Course