MOD
Supported, behaves as documentedCategory: Math and trigonometry · Last tested 2026-07-04
Support matrix
| Engine | Documented | Live-tested | Verdict |
|---|---|---|---|
| Excel | Yes | Not yet | n/a |
| Google Sheets | Yes | Not yet | n/a |
| LibreOffice Calc | Yes | Yes (24.2.7.2, 2026-07-04) | Supported, behaves as documented |
Executed test cases
LibreOffice Calc 24.2.7.2 (tested 2026-07-04)
| Formula | Description | Result | Expected | Verdict |
|---|---|---|---|---|
| =MOD(7,3) | Both operands positive | 1 | 1 | Matched |
| =MOD(-7,3) | Excel/LO MOD result takes the SIGN OF THE DIVISOR, not truncated-remainder semantics | 2 | 2 C-style '%' would give -1; spreadsheet MOD gives 2 because result = n - d*FLOOR(n/d) |
Matched |
| =MOD(7,-3) | Negative divisor: result takes the sign of the divisor | -2 | -2 | Matched |
| =MOD(5,0) | Division by zero -> #DIV/0! | #DIV/0! | #DIV/0! | Matched |
Docs & syntax
- Excel: official documentation
- Google Sheets: official documentation
- LibreOffice Calc: official documentation