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.
Compatibility
▾| Excel | ✔ |
| Gnumeric | ✔ |
| Google_sheets | ✔ |
| Libreoffice | ✔ |
| Numbers | ✔ |
| Onlyoffice | ✔ |
| Openoffice | ✔ |
| Wps | ✔ |
| Zoho | ✔ |
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.