Quick, clean, and to the point

Count cells equal to

Excel formula: Count cells equal to
Generic formula 

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:


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.

Dave Bruns

Excel Formula Training

Formulas are the key to getting work done in Excel. In this step-by-step training, 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 how to troubleshoot, trace errors, and fix problems. Start building valuable skills with Excel formulas today. Learn more.

Just a brief view of your website, and one specific idea - a "helper" value column - allowed me to do in less than two hours something I had been going down dead-ends with for two days. Thank you, thank you, thank you! -Roberta
Excel foundational video course
Excel Pivot Table video training course
Excel formulas and functions video training course
Excel Shortcuts Video Course
Excel Charts video training course