How to use the MOD function to get the remainder of division in Excel
How to use the MOD function to get the remainder of division in Excel: In Excel spreadsheets, some problems require the use of the remainder of division to combine with other functions to perform calculations. To get the remainder of division in Excel, we use the MOD function. This article will help you understand the syntax and how to use the MOD function in Excel through specific examples.
1. Structure of the MOD function
Function syntax: =MOD(number; divisor)
Where:
- Number: required argument, is the number being divided.
- Divisor: required argument, is the divisor.
Note:
- The result returned will have the same sign as the divisor.
- If the divisor is 0, the MOD function will return the #DIV/0! error value.
2. How to use the MOD function
For example, if we need to get the remainder of the calculation 5 divided by 3. Applying the structure of the MOD function above, we have the formula as follows: =MOD(5;3)
We will get the result as 2. Because 5 = 2 + (3 x 1)
If we need to get the remainder of -5 divided by 3. The formula is as follows: =MOD(-5;3)
The result of the calculation will be 1 because the result will be positive with the same sign as the divisor 3. In this case, the calculation to get the remainder result will be: -5 = (-2) x 3 + 1.
If we need to get the remainder of 5 divided by -3. The formula is as follows: =MOD(5;-3)
The result of the calculation will be -1 because the result will be negative with the same sign as the divisor -3. In this case, the calculation to get the remainder result will be: 5 = (-2) x -3 – 1.
If we need to get the remainder of -5 divided by -3. The formula is as follows: =MOD(-5;-3)
The result of the calculation will be -2 because the result will be negative with the same sign as the divisor -3. In this case, the calculation to get the remainder result will be: -5 = -3 – 2.
If we need to get the remainder of 5 divided by 0. The formula is as follows: =MOD(5;0)
At this point, the function will return the #DIV/0! error because in mathematics, a number cannot be divided by 0.
Thus, the above article has guided you on how to use the MOD function to get the remainder of division in Excel. Wish you success!