Topic: DMD0093 COUNTIF - Count If |
|
|
|
This instruction can only be used in the Expression parameter of the Calculate Expression (MATH) instruction.
The Count If (COUNTIFxx) math functions count the number of locations in the specified range that match the specified value by making the comparison by the function name.
There are six variants of the CountIf math function, and all six have the following three parameters:
The following are the 6 variants of the Count If math function:
|
|
COUNTIFEQ - Count If Equal to ExpressionIn the example to the right, D0 will contain the number of locations in the range of D100 through D109 that contain a value that is equal to 45.
|
|
|
|
COUNTIFNE - Count If Not Equal to ExpressionIn the example to the right, D0 will contain the number of locations in the range of D100 through D109 that contain a value that is not equal to 45.
|
|
|
|
COUNTIFLT - Count If Less Than ExpressionIn the example to the right, D0 will contain the number of locations in the range of D100 through D109 that contain a value that is less than 45.
|
|
|
|
COUNTIFLE - Count If Less Than or Equal to ExpressionIn the example to the right, D0 will contain the number of locations in the range of D100 through D109 that contain a value that is less than or equal to 45.
|
|
|
|
COUNTIFGT - Count If Greater Than ExpressionIn the example to the right, D0 will contain the number of locations in the range of D100 through D109 that contain a value that is greater than 45.
|
|
|
|
COUNTIFGE - Count If Greater Than or Equal to ExpressionIn the example to the right, D0 will contain the number of locations in the range of D100 through D109 that contain a value that is greater than or equal to 45. |
|
|
|
See Also:
|
|
|
|
Rung Example:
|
|
|