Explanation
In this example, the goal is to count cells equal to a specific value.
In this case, we want to count cells that contain “red” in therangeD5:D16.
This problem can be solved with the COUNTIF function and the SUMPRODUCT function, as explained below.
COUNTIF takes twoarguments:rangeandcriteria:
For this problem,rangeis D5:D16 andcriteriais “red”.
We place double quotes (“red”) because “red” is atext value.
With SUMPRODUCT
Another way to solve this problem is with theSUMPRODUCT functionandBoolean logic.