MOD Function in ONLYOFFICE Spreadsheet Editor: Syntax and Examples
Find leftovers after division, group repeating records and detect divisible quantities.
Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in ONLYOFFICE Spreadsheet Editor. How formula examples are checked
MOD function in ONLYOFFICE Spreadsheet Editor
Quick answer
Use =MOD(number,divisor) for the remainder after dividing a number by a divisor. If 17 items go into packs of 5, =MOD(17,5) has an expected remainder of 2. A zero divisor gives the officially documented #DIV/0! error.
What it does and why it matters
Find leftovers after division, group repeating records and detect divisible quantities. The examples are designed for a spreadsheet you can create yourself, so no sample download or proprietary data is needed. Only the function’s explicitly documented behaviour is attributed to ONLYOFFICE; sample outputs are described as expected, not observations.
Official syntax and argument definitions
=MOD(number, divisor)
| Argument | Required? | Type described by vendor | Meaning | Default |
|---|---|---|---|---|
number |
Yes | Numeric value or reference | Quantity to divide | None |
divisor |
Yes | Numeric value or reference | Quantity per group / denominator | None |
The ONLYOFFICE MOD reference documents this exact order and the #DIV/0! error when divisor is zero. It does not explicitly document the sign rule for negative dividends/divisors, so this page avoids presenting Excel’s sign rule as a tested ONLYOFFICE fact.
Applicability, release context, and formula settings
Documentation scope: The signature and core purpose above are documented by the unversioned English ONLYOFFICE Docs Spreadsheet Editor function reference, checked 11 October 2026 (UTC). That confirms help-site documentation, not a universal guarantee that the function behaves identically in every installed release, browser integration, mobile app, or Desktop Editors build. The referenced Docs release history and distinct Desktop Editors release history were checked; neither establishes a first-supported version for this function. First-supported Docs/Desktop/mobile versions: UNKNOWN; target-version native compatibility: NOT TESTED.
In English examples, formulas begin with =, function arguments are enclosed in parentheses, and multi-argument functions use a comma (see ONLYOFFICE’s formula-entry instructions). Under File → Advanced Settings, formula language and region can be changed; the official regional settings instructions discuss locale and decimal/thousands separators. Do not blindly substitute semicolons or localized function names: confirm the target editor’s language, regional settings and argument separator. All sample decimals below use a dot and English function names.
How to try the examples
- Create a new blank worksheet. Enter the input table below into the specified cell addresses; enter numeric values as numbers rather than quoted strings.
- Enter each formula in its listed output cell, beginning with
=. Choose Formula → Function to use the arguments wizard if necessary. - Compare with the values marked independently calculated expected results, not observed ONLYOFFICE outputs. Set the output cells to General or Number format as appropriate.
- Keep original input values unchanged so the formulas can be independently checked, and log discrepancies against the installed software version and locale before relying on the result.
Example worksheet: enter the inputs
| Row | A: Items (number) | B: Per pack (divisor) | Why |
|---|---|---|---|
| 1 | Items | Per pack | Text headers |
| 2 | 17 | 5 | Not evenly divisible |
| 3 | 21 | 6 | Not evenly divisible |
| 4 | 20 | 4 | Exact division |
| 5 | 0 | 7 | Nothing to pack |
| 6 | 7 | 0 | Invalid pack size |
| 7 | 14 | 5 | Two full packs plus leftovers |
Worked examples with expected results
| Output cell | Formula | Independently calculated expected result | Why |
|---|---|---|---|
| C2 | =MOD(A2,B2) |
2 |
17 = 3×5 + 2. |
| C3 | =MOD(A3,B3) |
3 |
21 = 3×6 + 3. |
| C4 | =MOD(A4,B4) |
0 |
20 = 5×4 + 0. |
| C5 | =MOD(A5,B5) |
0 |
Zero leaves no remainder. |
| C6 | =MOD(A6,B6) |
#DIV/0! |
Divisor zero; official error documentation. |
| C7 | =MOD(A7,B7) |
4 |
14 = 2×5 + 4. |
Copy the simple =MOD(A2,B2) pattern from C2 through C7 only after entering all inputs. Each stated numeric output is independently arithmetic-checked; the error is documented, not observed in an installed editor.
Advanced application
Build a packing dashboard and 1-based repeating label
To distinguish a full pack from a partial one, place this in D2:
=IF(MOD(A2,B2)=0,"Exact packs","Leftovers")
With 17 items and pack size 5, the expected label is Leftovers; in D4 with 20 items and size 4 the label is Exact packs. This uses the documented IF signature. Avoid copying to row 6 until invalid divisor data is handled, because MOD(...,0) is a real error, not a valid no-leftover result.
For a repeating 1-based position within each pack, use =MOD(A2-1,B2)+1. With the row-2 inputs it gives 2: (17-1) mod 5 +1 = 1+1. The -1/+1 shifts a zero-based remainder into labels 1 through 5. This is appropriate for positive integer item counts and pack sizes, not unrestricted negative/decimal inputs.
If you need whole packs as well as leftovers, INT documents integer flooring: =INT(A2/B2) would be 3 for 17/5. Check that B2 is positive before trusting the quantity.
Errors, limitations and troubleshooting
| Case | Status and guidance |
|---|---|
divisor=0 |
Documented #DIV/0!. Fix the input rather than suppressing the error and reporting zero leftovers. |
| Negative inputs | Only Excel’s documented rule establishes that its remainder has the divisor’s sign; ONLYOFFICE’s linked function reference does not specify the sign rule. Keep negative-input results PENDING_NATIVE_VERIFICATION. |
| Decimal quantities | A remainder may be fractional; floating-point representation can affect display. Verify precision requirements and avoid treating a rounded cell appearance as equality. |
| Text or empty cells | The ONLYOFFICE reference does not establish full conversion rules. Enter numeric inputs and test edge cases on the installed build. |
| Expecting quotient instead of remainder | For 17/5, MOD gives 2, not three full packs. Use the quotient/INT separately. |
| Repeating period differs from divisor | Double-check column B and absolute/relative references before copying formulas. |
Negative-case test plan, not an asserted native result: Type =MOD(-3,2) and =MOD(3,-2) in a scratch sheet. Microsoft’s Excel MOD reference says the Excel results are 1 and -1 respectively; do not label those as observed ONLYOFFICE results until executed there.
Excel and LibreOffice comparison
Excel’s MOD documentation shares MOD(number,divisor), reports #DIV/0! for zero divisor and specifies the remainder has the divisor’s sign. LibreOffice Calc separately documents mathematical functions and often displays argument syntax with semicolons. ONLYOFFICE’s current MOD page documents remainder and divide-by-zero, but does not provide a negative-sign convention; that difference in documented detail is not proof of a runtime behavioural difference. Keep negative-input portability unverified.
Related guides and link review
- ONLYOFFICE INT — integer part of quotient.
- ONLYOFFICE IF — label exact packs versus leftovers.
- ONLYOFFICE ABS — distance from zero; not interchangeable with a remainder.
Official reference and verification
- ONLYOFFICE Spreadsheet Editor — function documentation
- Docs release history
- Desktop Editors release history
- ONLYOFFICE’s formula-entry instructions
- official regional settings instructions
- documented IF signature
INT
Verification status: Official documentation checked; example outcomes were independently reasoned or arithmetically checked where applicable. Not executed in ONLYOFFICE Spreadsheet Editor.
- No genuine ONLYOFFICE Spreadsheet Editor screenshots are included; this guide does not use mock application images.