Instead, it’s possible for you to use the SUMPRODUCT andBoolean logic.

See below for a full explanation.

As a result, COUNTIF will never find a matching number and the result will always be zero.

Excel formula: Count cells that contain positive numbers

In other words, you’ve got the option to’t use anarray operationin place of arangeargument.

To do this, we use adouble negative(–).

In this formula, note we are hardcoding the value “25” and the length of 2.

Excel formula: Count cells between two numbers

This makes the formula more generic so it will support numbers of different lengths.

This version of the formula will work when there are numbers in column D, or text values.

For example, =LEFT(“apple”,3) returns “app”.

Excel formula: Count cells that contain odd numbers

LEN will also count characters in numbers, but number formatting is not included.

COUNTIF can be used to count…

Excel SUMPRODUCT function

Excel LEFT function

Excel LEN function

Excel COUNTIF function