MOD Function (OpenOffice Calc)

Math Beginner OpenOffice Calc Introduced in OpenOffice.org 3.0
remainder division math cyclic grouping

The MOD function in OpenOffice Calc returns the remainder after division. Learn syntax, behavior with negative numbers, examples, and best practices.

Compatibility

What the MOD Function Does

  • Returns the remainder of a division
  • Supports positive and negative numbers
  • Useful for cycles, patterns, grouping, and indexing
  • Works across sheets
  • Pairs naturally with INT and FLOOR

MOD is ideal when you need repeating sequences or position within a cycle.

Syntax

MOD(number; divisor)

Arguments:

  • number — The value to divide
  • divisor — The number to divide by
The divisor cannot be zero.

Behavior With Positive and Negative Numbers

OpenOffice Calc follows the mathematical definition:

[ \text{MOD}(a, b) = a - b \cdot \text{INT}(a/b) ]

This means:

Example Result Explanation
MOD(10; 3) 1 10 = 3×3 + 1
MOD(-10; 3) 2 -10 = 3×(-4) + 2
MOD(10; -3) -2 10 = (-3)×(-4) + -2

Basic Examples

Simple remainder

=MOD(10; 3)

Result: 1

Even/odd test

=MOD(A1; 2)

0 = even, 1 = odd.

Remainder of a formula result

=MOD(A1 - B1; 5)

MOD with cell references

=MOD(A1; B1)

Advanced Examples

Create repeating sequences (1,2,3,1,2,3…)

=MOD(ROW()-1; 3) + 1

Group values into buckets of 10

=MOD(A1; 10)

Extract the fractional part of a number

=MOD(A1; 1)

Determine day of week (0–6)

=MOD(A1 - DATE(1970;1;1); 7)

Pagination logic

Row number within a page of 50:

=MOD(ROW()-1; 50) + 1

Cycle through labels

=CHOOSE(MOD(ROW()-1; 3) + 1; "A"; "B"; "C")

MOD across sheets

=MOD(Sheet1.A1; 12)

Wrap-around indexing

=INDEX(List; MOD(n-1; ROWS(List)) + 1)

MOD for alternating row shading

=MOD(ROW(); 2)

MOD + INT = Full Division Breakdown

You can reconstruct any division:

[ a = b \cdot \text{INT}(a/b) + \text{MOD}(a, b) ]

Calc:

=B1 * INT(A1/B1) + MOD(A1; B1)

Common Errors and Fixes

MOD returns Err:532 (Division by zero)

Occurs when:

  • Divisor = 0
  • Divisor is empty
  • Divisor is text

MOD returns Err:502 (Invalid argument)

Occurs when:

  • Inputs are text
  • A malformed reference is used

MOD returns unexpected results

Possible causes:

  • Negative numbers behaving differently than expected
  • Divisor sign affecting remainder sign
  • Text numbers not converted to numeric

MOD ignores values you expected it to include

MOD ignores:

  • Text numbers ("123")
  • Empty cells
  • Logical values
  • Errors

MOD includes values you expected it to ignore

MOD includes:

  • Dates
  • Times
  • Numeric results of formulas

Err:508 — Missing parenthesis

Usually caused by:

  • Missing )
  • Using commas instead of semicolons

Best Practices

  • Use MOD for cycles, patterns, and grouping
  • Use MOD(A1; 2) for even/odd logic
  • Use MOD with ROW() for alternating formatting
  • Use MOD with INDEX for wrap‑around lists
  • Convert imported text numbers to real numbers
  • Use named ranges for cleaner formulas
MOD is the backbone of cyclic logic — if something repeats, MOD can model it.

Copyright 2026. All rights reserved.