Category: FUNCTION | Updated: 2026-11-22

[FACT Function] How to Calculate the Factorial of a Number

Syntax

=FACT(value)
  • value: A number greater than or equal to 0 whose factorial you want to calculate (decimals are truncated).

Example Table

Examples of calculating factorials for permutations and probability.

Number (Col A) Formula Output Calculation
0 =FACT(A2) 1 0! = 1
3 =FACT(A3) 6 3 × 2 × 1
5 =FACT(A4) 120 5 × 4 × 3 × 2 × 1
10 =FACT(A5) 3628800 10 × 9 × … × 1

Common Errors and Caveats

  • #NUM! error: Occurs if you pass a negative number, or a number of 171 or greater (because the result exceeds the maximum number Google Sheets can represent).
  • #VALUE! error: Occurs if you pass a non-numeric text string.

Frequently Asked Questions

Q. What does FACT(0) return?

A. It returns 1, because by mathematical definition the factorial of 0 (0!) is 1.

Q. Does passing a decimal to FACT cause an error?

A. No, it does not cause an error; the decimal part is automatically truncated to an integer. For example, "=FACT(4.9)" returns 24, the same as "=FACT(4)".