Count Errors in Excel using Formula, LAMBDA, VBA
Jul 4, 2021
=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
NextEnd Function
YouTube:
https://youtu.be/IRg6kqa4hds