For convenience, the range B5:B15 isnameddata.

This problem can be solved with the COUNTIF function or the SUMPRODUCT function.

Both methods are explained below.

Excel formula: Count cells that contain positive numbers

COUNTIF function

TheCOUNT functioncounts the number of cells in a range that match the supplied criteria.

COUNTIFS is in agroup of eight functionsthat share this syntax.

Excel formula: Count cells that contain errors

Excel COUNTIF function

Excel SUMPRODUCT function