Empty cells and cells that contain numeric values or errors should not be included in the count.

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

Both approaches are explained below.

Excel formula: Count cells that contain specific text

For convenience,datais thenamed rangeB5:B15.

The asterisk (*) matches zero or more characters of any kind.

We want to matchalltext values.

Excel formula: Count cells equal to case sensitive

To do this, we provide the asterisk (*) by itself for criteria.

SUMPRODUCT function

Another way to solve this problem is to use theSUMPRODUCT functionwith theISTEXT function.

SUMPRODUCT makes it easy to perform alogical teston a range, and then count the results.

Excel formula: Count cells that contain numbers

The test is performed with the ISTEXT function.

Note: the SUMPRODUCT formulas above may seem complex, but usingBoolean operations in array formulasis powerful and flexible.

NOT Function

The Excel NOT function returns the opposite of a given logical or Boolean value.

Excel COUNTIF function

When given TRUE, NOT returns FALSE.

When given FALSE, NOT returns TRUE.

Use the NOT function to reverse a logical value.

Excel COUNTIFS function

Excel SUMPRODUCT function

Excel ISTEXT function

Excel NOT function