Count cells equal to

Generic formula
=COUNTIF(range,value)
Summary
To count the number of cells equal to a specific value, you can use the COUNTIF function. In the example shown, G6 contains this formula:
=COUNTIF(D5:D11,"red")
Explanation
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.
See also
Download 200+ Excel Shortcuts
Get over 200 Excel shortcuts for Windows and Mac in one handy PDF.