The mod function is a remainder function, its format is: mod(nExp1,nExp2), which is the remainder after dividing two numerical expressions. The sign of the result is the same as the divisor.
Syntax
MOD(number, divisor)
MOD function syntax has the following parameters:
Number Required. The dividend to be calculated as the remainder.
Divisor Required. divisor.
Note:
If the divisor is 0, MOD returns #DIV/0! .
MOD function can be expressed by borrowing INT function:
MOD (n,d) = n-d * INT (n/d)
Example:
MOD(3, 2) is equal to 1
MOD(-3, 2 ) is equal to 1
MOD(3, -2) is equal to -1
MOD(-3, -2) is equal to -1
MOD(-3, 0) is equal to -3
MOD(3, 0) is equal to 3
MOD(2, 0) is equal to 2
MOD(4, 3) is equal to 1
Recommended learning: Excel Basic Tutorial
The above is the detailed content of What is the use of mod function in excel?. For more information, please follow other related articles on the PHP Chinese website!