The MOD function in Excel is used to return the remainder after a number is divided by a divisor. It is particularly useful for calculating periodic occurrences or for extracting cyclic data.
Syntax
MOD(number, divisor)
number
: The number for which you want to find the remainder.divisor
: The number by which you want to divide the number.
Example
Suppose you want to calculate the remainder when dividing a number by a divisor.
Data
Let's say we have the following data:
- Number: 10
- Divisor: 3
Steps
Enter the number 10 in cell A1 and the divisor 3 in cell B1.
Use the MOD function to find the remainder. In cell C1, enter the following formula:
=MOD(A1, B1)
Press Enter.
Explanation of the Formula
A1
contains the number 10.B1
contains the divisor 3.
Result
The formula returns 1
, indicating that the remainder when dividing 10 by 3 is 1.
Another Example
Suppose you want to find the remainder when dividing a range of numbers by a divisor.
Data
Let's say we have a range of numbers in column A (A1
) and a divisor in cell B1:A | B |
---|---|
10 | 3 |
20 | 3 |
25 | 4 |
35 | 5 |
40 | 6 |
Steps
Enter the numbers in column A (A1) and the corresponding divisor in cell B1.
Use the MOD function to find the remainder for each number. In cell C1, enter the following formula:
=MOD(A1, $B$1)
Copy the formula from C1 down to C5.
Explanation of the Formula
A1:A5
contains the range of numbers.$B$1
is the absolute reference to the divisor in cell B1, ensuring that the same divisor is used for all calculations.
Result
A | B | C |
---|---|---|
10 | 3 | 1 |
20 | 3 | 2 |
25 | 4 | 1 |
35 | 5 | 0 |
40 | 6 | 4 |
The MOD function calculates the remainder for each number when divided by the given divisor.
No comments:
Post a Comment