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 between two numbers

COUNTIF function

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

Note that cell B9 is excluded since it is equal to zero.

Also notice that we supply thecriteriain double quotes (">0").

Excel formula: Count cells greater than

COUNTIF is part of agroup of Excel functionsthat split logical expressions into two parts.

Excel formula: Count cells that contain negative numbers

Excel COUNTIF function

Excel SUMPRODUCT function