# CountPassFail

Counts and returns passes, failures and total events for a given referenced value.

Inputs

The CountPassFail function Functions are tools that are available in Spreadsheet for processing and analyzing acquisitions or other results. You can add functions to your Spreadsheet job to create tool chains and produce results for specific applications. has the following syntax:

CountPassFail(Event, Value, Reset)

See the table for a description of the available parameters.

Parameter | Description
--- | ---
Event | Specifies the event on which to increment the counter. This parameter needs to refer to any event with a timestamp, for example, one of the following: A cell containing an Event function. A cell containing a Button function.
Value | Specifies a required reference to the cell containing the source of the data stream to be counted. Must reference a numeric or Status cell. If no cell is referenced, the function returns a #ERR for all results. The counter that is incremented (Pass, Fail or #ERR) is based on the returned Value, as follows:
Pass | Value > 0
Fail | Value = 0
#ERR | Value < 0
Reset | Forces the counters to reset at the next event. Specifies whether the counters are reset to zero when the specified Event occurs. This parameter automatically references the Reset button, which is inserted into the spreadsheet when the function is initially created. Note: If this checkbox is manually toggled in the Property Sheet, the reference to the Reset button is removed. To use the Reset button, this parameter must reference the cell containing the Reset button.
0 = OFF (default) | Do not reset counters.
1 = ON | Reset counters when the specified Event occurs.

Outputs

Returns | A Count data structure containing the incremented counters or #ERR if any of the input parameters are invalid.
Results | When CountPassFail is initially inserted into a cell, a result table and a Reset button are created in the spreadsheet. When the Reset button is pressed, all counters are reset to zero. The following Clocked Data Storage Vision Data Access functions are automatically inserted into the spreadsheet to create the result table:
Label | Function | Description
Passes | GetPassCount(Count) | The incremental count of passes. The counter is incremented when the returned is greater than 0.
Failures | GetFailCount(Count) | The incremental count of failures. The counter is incremented when the returned Value is equal to 0.
Errors | GetErrorCount(Count) | The incremental count of errors. The counter is incremented when the returned Value is less than 0.
Total | GetTotalCount(Count) | The total number of passes, failures and errors.