This can be done with the SUMPRODUCT function together with the ISODD function.

Instead of ISODD, the MOD function can also be used.

Both approaches are explained below.

Excel formula: Count cells that contain numbers

SUMPRODUCT with ISODD

The SUMPRODUCT function works directly with arrays.

ISODD is one of these functions.

The + operator is an easy way to make ISODD return all results.

Excel formula: Count cells over n characters

We therefore test for 1.

ISODD will return the #VALUE error if a value is not numeric.

MOD Function

The Excel MOD function returns the remainder of two numbers after division.

Excel formula: Count cells that contain negative numbers

For example, MOD(10,3) = 1.

The result of MOD carries the same sign as the divisor.

ISEVEN will return the #VALUE error if a value is not numeric.

Excel SUMPRODUCT function

Excel ISODD function

Excel MOD function

Excel ISEVEN function