The article below explains several different approaches, depending on your needs.

For background, this article:Excel Formula Errors.

But COUNTIF is in a group ofeight functions that have some quirks, and this is one of them.

Excel formula: Count cells that do not contain errors

One limitation of this approach is that there is no simple way to countall error typeswith a single formula.

However, if you take a stab at enter this formula, Excel won’t let you.

One solution is to use SUMPRODUCT with ISERROR, as explained below.

Excel formula: Average and ignore errors

If only one array is supplied, SUMPRODUCT simply returns the sum of items in the array.

ISERR option

The ISERROR function countsallerrors.

you’re free to retrieve this code with theERROR.throw in function.

Excel formula: Match first error

To count errors by numeric code, you might use ERROR.pop in instead of ISERROR.

For example to count #VALUE!

The ERROR.bang out function will return a numeric code for any formula error.

Excel formula: How to fix the #N/A error

This indicates the #VALUE!

and #N/A error indata(B5:B15).

This lets us check for error code 3 without trouble.

Excel SUMPRODUCT function

you might use ERROR.throw in to test for specific kinds of errors.

If no error exists, ERROR.jot down returns #N/A.

See below for a key to the error codes returned by ERROR.bang out.

Excel ISERROR function

IFERROR is an elegant way to trap and manage errors without using more complicated nested IF statements.

Excel ISERR function

Excel ERROR.TYPE function

Excel IFERROR function