MOD

The MOD function returns the remainder of the division of two numbers.

Syntax

MOD(
    number,
    divisor
)

Parameters
  • number: Dividend of the division or reference to the column that contains it.
  • divisor: Divisor of the division or reference to the column that contains it.
Returned value

The MOD function returns an integer.

Additional Information

This function works as follows: It considers the remainder of the division between the two numbers and, if this is a negative number, the divisor value is added the least number of times necessary so that the result is greater than zero. Then, if divisor is a negative number, the minus sign is applied to the result (regardless of the sign it had).

This implies that the result of the function always has the same sign as the divisor. If divisor is 0, the MOD function returns an error.

Examples

The MOD function applied to pairs of numbers in which the divisor is a positive number is shown below:

MOD function. Example of use

And the same function applied to the same pairs of numbers in which the divisor takes the negative value:

MOD function. Example of use

Related functions
Category
Mathematical and trigonometric
Submitted by admin on Tue, 12/04/2018 - 12:19