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.

Excel formula: Count cells that do not contain

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.

Excel formula: Count cells that contain text

Excel formula: Cell contains specific text

Excel formula: Running count of occurrence in list

Excel formula: Summary count with COUNTIF

Excel formula: Count cells that contain either x or y

Excel COUNTIF function

Excel SUMPRODUCT function

Article image

Article image