MOD / MODULUS

Calculates the modulus of a specified number with a specified divisor. The resulting value is the remainder after division of the value by the divisor.

Syntax

=MOD(value, divisor)

=MODULUS(value, divisor)

📘

The sign of the result matches the sign of the value; if a negative value is supplied for value, the result is a negative value. The value and divisor can both be non-integers.

Arguments

ArgumentTypeDescription
valueNumberThe value to modulo
divisorNumberThe divisor of the modulo operation. Cannot be 0.

Examples

=MOD(123, 2)1
Calculates 123 modulo 2 (the remainder of 123 divided by 2)

=MOD(3.14159, 2)1.14159
Calculates 3.14159 modulo 2

=MODULUS(-2.178, 1.2)-0.318
Calculates -2.718 modulo 2

=MOD(5, 0)#ERROR!
Calculates 5 modulo 0