Returns the remainder when one integer is divided by another.
MOD(number; divisor)
For integer arguments this function returns number modulo divisor, that is the remainder when number is divided by divisor. This function is implemented as number - divisor * INT( number/divisor) , and this formula gives the result if the arguments are not integer.
MOD(22; 3)
returns 1, the remainder when 22 is divided by 3.
MOD(11.25; 2.5)
returns 1.25.
Scheduling Work Shifts
The MOD (modulo) function is a useful tool for tasks that involve a cyclical or repeating pattern. A great example is scheduling work shifts on a rotating basis.
Imagine a small business with four employees: Alice, Bob, Charlie, and David. They work a four-day schedule, with one employee assigned to the special "closing" shift each day. The manager wants to assign the closing shift on a rotating basis, starting with Alice on Day 1.
The MOD function can be used to determine who gets the closing shift on any given day.
The formula is: MOD(Day Number, Number of Employees)
Let's set up the mapping:
Here is a table showing the schedule for the first 10 days:
Day Number | MOD(Day Number, 4) | Remainder | Employee on Closing Shift | ||
|---|---|---|---|---|---|
A | B | C | D | ||
1 | 1 | MOD(1, 4) | 1 | Alice | |
2 | 2 | MOD(2, 4) | 2 | Bob | |
3 | 3 | MOD(3, 4) | 3 | Charlie | |
4 | 4 | MOD(4, 4) | 0 | David | |
5 | 5 | MOD(5, 4) | 1 | Alice | |
6 | 6 | MOD(6, 4) | 2 | Bob | |
7 | 7 | MOD(7, 4) | 3 | Charlie | |
8 | 8 | MOD(8, 4) | 0 | David | |
9 | 9 | MOD(9, 4) | 1 | Alice | |
10 | 10 | MOD(10, 4) | 2 | Bob |
As you can see, the MOD function handles the cycle. When the day number exceeds the number of employees, the remainder "resets" back to 1, restarting the rotation with Alice. This simple calculation makes it easy to predict who will be on the closing shift on any future day without manually tracking the schedule.
PRODUCT & FEATURES
RESOURCES
Terms | Privacy | Spam Policy
© 2026 Zapof