Topic: DMD0118 SUM IF - Sum If |
|
|
|
This instruction can only be used in the Expression parameter of the Calculate Expression (MATH) instruction.
Each of the Sum If math functions sums the values in the locations in the specified range that match the specified value by making the comparison by the function name.
There are six variants of the Sum If math function, and all six have the following three parameters:
The following are the 6 variants of the Sum If math function:
|
|
SUMIFEQ - Sum If Equal to ExpressionIn the example to the right, D0 will sum the values from the locations in the range of D100 through D109 that contain a value that is equal to 45.
|
|
|
|
SUMIFNE - Sum If Not Equal to ExpressionIn the example to the right, D0 will sum the values from the locations in the range of D100 through D109 that contain a value that is not equal to 45.
|
|
|
|
SUMIFLT - Sum If Less Than ExpressionIn the example to the right, D0 will sum the values from the locations in the range of D100 through D109 that contain a value that is less than 45.
|
|
|
|
SUMIFLE - Sum If Less Than or Equal to ExpressionIn the example to the right, D0 will sum the values from the locations in the range of D100 through D109 that contain a value that is less than or equal to 45.
|
|
|
|
SUMIFGT - Sum If Greater Than ExpressionIn the example to the right, D0 will sum the values from the locations in the range of D100 through D109 that contain a value that is greater than 45.
|
|
|
|
SUMIFGE - Sum If Greater Than or Equal to ExpressionIn the example to the right, D0 will sum the values from the locations in the range of D100 through D109 that contain a value that is greater than or equal to 45. |
|
|
|
See Also:
|
|
|
|
Rung Example:
|
|
|