Factorial and Combinatorics with FACT

Excel Formulas › Math

All versionsFACT

FACT computes a factorial — n! = n × (n−1) × … × 1 — the building block of permutations, combinations, and probability. FACT(5) = 120.


Quick formula: factorial of A2:
=FACT(A2)
Multiplies all whole numbers from 1 to n. FACT(0) = 1 by definition.

Functions used (tap for the full reference guide):

The example

5! = 120.

AB
1nn!
25120
3103,628,800

The formula

The formula:

=FACT(A2) // 5! = 120

How it works

How it works:

  1. FACT(n) multiplies every whole number from 1 to n.
  2. It grows extremely fast — 10! is over 3.6 million, 20! exceeds 2 quintillion.
  3. Combine for arrangements: permutations =FACT(n)/FACT(n-k), combinations =FACT(n)/(FACT(k)*FACT(n-k)).
  4. Excel also has PERMUT and COMBIN that do these directly.

Use COMBIN/PERMUT for counting: they’re cleaner and avoid overflow on large n. FACT is best for the raw factorial or when you need the full expression. For huge n, factorials exceed Excel’s number limit and error.

Try it: interactive demo

Live demo

Enter n.

n! =

Variations

Combinations

Choose k of n:

=COMBIN(n, k)

Permutations

Ordered:

=PERMUT(n, k)

By formula

From FACT:

=FACT(n)/(FACT(k)*FACT(n-k))

Pitfalls & errors

Overflow. Factorials above ~170 exceed Excel’s maximum and error.

Whole numbers only. FACT truncates decimals; negative inputs error.

Prefer COMBIN/PERMUT. They avoid intermediate overflow for counting problems.

Practice workbook

📊
Download the free Factorial and Combinatorics with FACT practice workbook
A factorial sheet with the combinations, permutations, and formula variants, plus 4 challenges with answers. No sign-up required.

Frequently asked questions

How do I calculate a factorial in Excel?
Use =FACT(n), which multiplies all whole numbers from 1 to n. FACT(5) = 120 and FACT(0) = 1.
How do I compute combinations and permutations?
Use =COMBIN(n, k) for combinations and =PERMUT(n, k) for permutations — cleaner than building them from FACT.
Why does FACT return an error?
The input is negative, or the factorial is too large (above ~170!) and exceeds Excel's number limit.

Stop fighting formulas. Learn them in a day.

This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.

See the Formulas & Functions Class

Related formulas: Combinations & permutations · Powers & roots · Random integer

Function references: FACT