Excel MOD Function
The Excel MOD function returns the remainder of two numbers after division. For example, MOD(10,3) = 1. The result of MOD carries the same sign as the divisor.
- number - The number to be divided.
- divisor - The number to divide with.
The MOD function returns the remainder after division. For example, MOD(3,2) returns 1, because 2 goes into 3 once, with a remainder of 1.
The MOD function takes two arguments: number and divisor. Number is the number to be divided, and divisor is the number used to divide. Both arguments are required. If either argument is not numeric, the MOD function returns #VALUE!.
The result from the MOD function is calculated with an equation like this:
where n is number, d is divisor, and INT is the INT function. This can create some unexpected results because of the way that the INT function rounds negative numbers down, way from zero:
MOD with negative numbers is implemented differently in different languages.
Below are some examples of the MOD function with hardcoded values:
The result from MOD carries the same sign as divisor. If divisor is positive, the result from MOD is positive, if divisor is negative, the result from MOD is negative:
Time from datetime
=MOD(A1,1) // return time only
With very large numbers, you may see the MOD function return a #NUM error. In that case, you can try an alternative version based on the INT function: