The best way to solve this problem is to use the SUMPRODUCT function together with the ISERROR function.

you could also use the COUNTIF function or COUNTIFS function to exclude specific errors.

Both approaches are explained below.

Excel formula: Count cells that contain errors

Notice both values are enclosed in double quotes.

However, this approach is tedious if the goal is to exclude all types of errors from the count.

In that case, the SUMPRODUCT option below is more straightforward.

Excel formula: Count cells that contain numbers

SUMPRODUCT function

The SUMPRODUCT function works directly with arrays and ranges.

This array is now in the correct form.

The difference is that ISERR ignores #N/A errors.

Excel ISERROR function

When given TRUE, NOT returns FALSE.

When given FALSE, NOT returns TRUE.

Use the NOT function to reverse a logical value.

Excel NOT function

SUMPRODUCT Function

The Excel SUMPRODUCT function multipliesrangesorarraystogether and returns the sum of products.

COUNTIF can be used to count…

Excel SUMPRODUCT function

Excel ISERR function

Excel COUNTIF function