Contact

FACT Function (LibreOffice Calc)

Math Beginner LibreOffice Calc LibreOffice 3.0

The FACT function in LibreOffice Calc returns the factorial of a non‑negative integer. It is essential for combinatorics, permutations, probability, and number theory.

Verification status: Consult the documentation and examples below. Native application testing has not been documented for this guide. How formula examples are checked

The **FACT** function returns the factorial of a non‑negative integer in LibreOffice Calc. Factorials grow extremely quickly and are fundamental in combinatorics, permutations, probability, and number theory. FACT pairs naturally with `COMBIN`, `PERMUT`, and `FACTDOUBLE`.

What the FACT Function Does

  • Computes the factorial of a non‑negative integer
  • Defined as:
    n! = n × (n‑1) × (n‑2) × … × 1
  • Used in permutations, combinations, and probability
  • Grows extremely fast (overflow is common)

It is designed to be precise, efficient, and universally compatible.

Syntax

FACT(number)

Arguments

  • number:
    A non‑negative integer.
    Non‑integer values are truncated.

Basic Examples

Factorial of a number

=FACT(5)

Returns 120.

Factorial of zero

=FACT(0)

Returns 1.

FACT with non‑integer input

=FACT(5.9)

Equivalent to FACT(5) → returns 120.

FACT with a cell reference

=FACT(A1)

Computes the factorial of A1.

Advanced Examples

Permutations (manual formula)

=FACT(A1) / FACT(A1 - B1)

Equivalent to PERMUT(A1; B1).

Combinations (manual formula)

=FACT(A1) / (FACT(B1) * FACT(A1 - B1))

Equivalent to COMBIN(A1; B1).

Probability of unique arrangements

=FACT(A1)

Useful for counting permutations of distinct items.

Factorial growth demonstration

=FACT(10)

Returns 3,628,800.

Factorial for binomial coefficients

=FACT(A1) / (FACT(B1) * FACT(A1 - B1))

Used in probability and statistics.

Double factorial alternative

=FACT(A1) / (2^((A1/2)) * FACT(A1/2))

Equivalent to FACTDOUBLE for even numbers.

FACT with PRODUCT (manual factorial)

=PRODUCT(1:A1)

Equivalent to FACT(A1).

Common Errors and Fixes

Err:502 — Invalid argument

Occurs when:

  • number is negative
  • number is text
  • number cannot be coerced to a non‑negative integer

Err:503 — Overflow

Occurs when:

  • number is too large
  • factorial exceeds Calc’s numeric limit

Example:
FACT(171) overflows in most spreadsheet engines.

FACT returns unexpected results

Cause:

  • Non‑integer values are truncated
    Example: FACT(4.8) → FACT(4) → 24.

Best Practices

  • Use FACT for combinatorics and probability
  • Avoid large inputs (factorials grow extremely fast)
  • Use COMBIN and PERMUT for cleaner formulas
  • Use FACTDOUBLE for double factorials
  • Use PRODUCT(1:A1) for manual factorials
Factorials explode in size — even moderate inputs can exceed spreadsheet limits. Use FACT carefully in large combinatorial models.
  • Use FACTDOUBLE for double factorials
  • Use COMBIN for combinations
  • Use COMBINA for combinations with repetition
  • Use PERMUT for permutations
  • Use PERMUTATIONA for permutations with repetition
  • Use PRODUCT(1:A1) for manual factorials

By mastering FACT and its related combinatorics functions, you can build powerful probability, counting, and number theory models in LibreOffice Calc.


Reproducible example (tested in LibreOffice Calc)

This standalone example was calculated in LibreOffice Calc 25.2.3.2 and matched the expected value. It is a practical cross-check of one usage, not proof that every example elsewhere on this page is correct.

=FACT(5)

Expected result: 120.

Calculate the factorial of five.

If the result differs, check the referenced cells, argument separators and number formatting. For more information, consult the LibreOffice Calc official help.