Count Errors in Excel using Formula, LAMBDA, VBA

--

=SUM(-ISERROR(C3:C12))

Excel does not have an inbuilt function to count errors.

ISERROR will return an array of TRUE / FALSE.
Unary (double negative) will coerce that into 1 / 0.

Finally we count the number of 1.

LAMBDA:
The same formula can be used as a LAMBDA as well:

=LAMBDA(range,SUM(--ISERROR(range)))

In VBA:

Function Count_Errors_VBA(cells As Range) As LongDim cell As Range
For Each cell In cells
If Application.WorksheetFunction.IsError(cell) Then Count_Errors_VBA = Count_Errors_VBA + 1
Next
End Function

YouTube:
https://youtu.be/IRg6kqa4hds

GitHub:
https://github.com/havishmad/excel_count_errors

--

--

HAVISH MADHVAPATY
HAVISH MADHVAPATY

Written by HAVISH MADHVAPATY

Founder @ Havish M Consulting | 40u40 [Analytics Insight] | AuthorX20 | MOS | MCDA | MCT | Taught at IIM ABCLK

No responses yet