MOD
- MOD(number, divisor)[source]
Returns the remainder after dividing number by divisor.
The MOD function calculates the modulus of a number with respect to a divisor, returning the remainder of the division. For example, if 5 is divided by 3, the remainder is 2. Therefore, MOD(5, 3) = 2. If any input is blank or in an error state, the formula evaluates to an error. If either input is an array, the operation is performed element-wise and an array type is returned.
- Parameters:
- Return type:
- Returns:
The remainder of the division number % divisor.
Supported types:
INTEGER
DECIMAL
INTEGER_ARRAY
DECIMAL_ARRAY
- Raises:
ValueError – If either number or divisor is not numeric.
Examples
Basic usage:
MOD(10, 3) # Returns 1
With arrays:
MOD([10, 20, 30], 7) # Returns [3, 6, 2]