FACT Function (LibreOffice Calc)
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, examples and any stated test scope below. How formula examples are checked
Availability and version history
- Introduced: Documented by LibreOffice 26.8.1.1; original introduction not established.
- Availability: Supported in LibreOffice 26.8.1.1, verified against its function registry. This identifies a supported release, not a final working version.
- Scope: Desktop Calc, using the English function name. Availability in other spreadsheet applications is separate.
- Checked: 2026-10-14 — function reference; versioned support. Documentation/source check; not a new native test. Existing example-specific test claims below retain their stated scope.
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
Related Patterns and Alternatives
- 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.