MOD function
Calculate gross hours for an overnight shift.
Math and trigonometry
Where can you use it?
Reporting, manufacturing and engineering teams. When a total, rounding step or numerical transformation is needed, use the example to see which operation fits your inputs.
Scenario in the workbook
Find the remainder after packing. A positive divisor gives a nonnegative remainder.
A worked example from the workbook
| Row | A | B |
|---|---|---|
| 6 | First value | Second value |
| 7 | 17 | 5 |
| 8 | -17 | 5 |
| 9 | 3 | 5 |
Record 1
=MOD(A7,B7)Expected result2
See the inputs and instructions for all 3 examplesCopyable formulas
English Excel · en-US
=MOD(TIME(6,0,0)-TIME(22,0,0),1)*24Turkish Excel · tr-TR
=MOD(ZAMAN(6;0;0)-ZAMAN(22;0;0);1)*24Example and expected result
MOD wraps the negative time difference within one day. Multiply by 24 for hours. This example is for shifts shorter than 24 hours.
Expected result 8 hours.
Worked examples
Find the remainder after packing. A positive divisor gives a nonnegative remainder.
Open the English sheet. Inputs begin at A6. F7:F9 show the live results and G7:G9 show the original results for comparison.
| Row | A | B |
|---|---|---|
| 6 | First value | Second value |
| 7 | 17 | 5 |
| 8 | -17 | 5 |
| 9 | 3 | 5 |
| Case | Formula | Expected result |
|---|---|---|
| Record 1 | =MOD(A7,B7) |
2 |
| Record 2 | =MOD(A8,B8) |
3 |
| Record 3 | =MOD(A9,B9) |
3 |