🚀The world's best VBA AI has evolved. ExcelMaster is now an autonomous Agent.Read more →
Back to Blog

Excel Factorial (FACT) — n!, FACTDOUBLE & MULTINOMIAL (and the 171! Overflow)

|

Excel Factorial (FACT) — n!, FACTDOUBLE & MULTINOMIAL (and the 171! Overflow)

TL;DR=FACT(n) returns n factorialn × (n−1) × … × 1 — which counts how many ways you can arrange n distinct things in order. =FACT(5) is 120. Two facts save you every time: FACT(0) is 1 (there's exactly one way to arrange nothing), and factorials explodeFACT(170) is a 307-digit number, and FACT(171) overflows Excel and returns #NUM!. FACTDOUBLE skips every other term; MULTINOMIAL handles arrangements with repeated groups. FACT is the building block under COMBIN and PERMUT.

=FACT(5)          ' 5×4×3×2×1 -> 120
=FACT(0)          ' by definition -> 1
=FACT(171)        ' too big for Excel -> #NUM!  (170! is the ceiling)
=FACTDOUBLE(7)    ' 7×5×3×1 -> 105
=MULTINOMIAL(2,3,4) ' 9! / (2!·3!·4!) -> 1260

Most pages define FACT in one line — "returns the factorial of a number" — and show =FACT(5). That's the easy part. What actually trips people up is what a factorial is for, why FACT(0) returns 1 instead of 0, and why a modest-looking input like 171 suddenly throws an error. Get the meaning first and every one of those stops being surprising.

What you'll learn

  • The mental model: a factorial counts orderings of distinct items
  • Why =FACT(0) is 1, not 0 — and why that convention matters
  • Why =FACT(171) returns #NUM! and 170! is Excel's hard ceiling
  • How FACT truncates decimals and rejects negatives
  • FACTDOUBLE (skip-a-term products) and MULTINOMIAL (grouped arrangements)
  • Why FACT is the atom that COMBIN and PERMUT are built from

The mental model: a factorial counts orderings

FACT(n) isn't an abstract math trick — it answers a concrete question: in how many different orders can I arrange n distinct things? Line up 3 books on a shelf and there are 3! = 3×2×1 = 6 possible orders. Add a fourth book and it's 4! = 24. Each new item multiplies the count by the number of positions it could take, which is why the formula is a running product: n × (n−1) × (n−2) × … × 1.

That "running product" framing is the thread that ties this whole family together. A factorial is just a PRODUCT of a countdown. Combinations and permutations are ratios of two such products. Once you see factorial as multiplication that starts small and compounds fast, both its power and its failure mode (it gets enormous) follow naturally.

Why FACT(0) is 1, not 0

This looks like a bug and is actually the linchpin of the whole system:

=FACT(0)   ' -> 1

There is exactly one way to arrange an empty set — the empty arrangement — so 0! is defined as 1, not 0. Beyond the "one way to arrange nothing" intuition, the convention is what makes the combination and permutation formulas work at their edges: COMBIN(n, n) (choose all of them) has to equal 1, and the only way the factorial formula delivers that is if 0! = 1. If FACT(0) returned 0, you'd get a division-by-zero everywhere those formulas hit a boundary. So the "weird" answer is exactly the answer that keeps everything else consistent — memorize it as a rule, not a curiosity.

The overflow ceiling: FACT(171) is #NUM!

Factorials grow faster than almost anything else you'll type into a cell, and that has a hard consequence:

=FACT(170)   ' -> 7.257...E+306   (a 307-digit number, still fine)
=FACT(171)   ' -> #NUM!           (past Excel's largest number)

Excel's biggest representable number is about 1.8×10³⁰⁸. FACT(170) squeaks in just under it; FACT(171) blows past it and returns #NUM! — the "number out of range" error. 170! is the largest factorial Excel can compute, full stop. If you're feeding FACT into a probability formula and you see #NUM!, this is usually why: some intermediate factorial overflowed, even though the final answer (a ratio) would have been small. That's exactly the problem COMBIN and PERMUT solve — they compute the ratio without ever materializing the giant factorials. Reach for them instead of building =FACT(n)/FACT(n-k) by hand.

Decimals and negatives

Two smaller rules round out FACT's behavior:

=FACT(5.9)   ' truncates to 5 -> 120   (not rounded to 6)
=FACT(-1)    ' factorials aren't defined for negatives -> #NUM!

A non-integer input is truncated, not rounded — FACT(5.9) uses 5, not 6. And factorials have no meaning for negative numbers, so any negative argument returns #NUM!. (The full "generalized factorial" for non-integers is the gamma function, which Excel exposes separately as GAMMA / GAMMALN; FACT itself is integers-only.)

FACTDOUBLE: skip every other term

FACTDOUBLE computes the double factorial — the product that skips every other number on the way down:

=FACTDOUBLE(7)   ' 7×5×3×1 -> 105   (odd n: odd numbers only)
=FACTDOUBLE(8)   ' 8×6×4×2 -> 384   (even n: even numbers only)
=FACTDOUBLE(0)   ' -> 1

For an odd n it multiplies the odd numbers down to 1; for an even n, the even numbers down to 2. It shows up in combinatorics and in certain physics and statistics formulas (integrals of powers of sine and cosine, for instance). You won't need it often, but when a formula calls for n!! — two exclamation marks, the double factorial — this is the function, not FACT(FACT(n)).

MULTINOMIAL: arrangements with repeated groups

MULTINOMIAL answers a subtler counting question: how many distinct ways can you arrange items when some are identical? Its formula is the sum of the arguments' factorial, divided by the product of each argument's factorial:

=MULTINOMIAL(2, 3, 4)   ' (2+3+4)! / (2!·3!·4!) = 9!/288 -> 1260

The classic use is counting arrangements of a word with repeated letters, or splitting n items into groups of fixed sizes. Arranging the letters of a 9-letter word made of one letter repeated twice, another three times, and another four times gives 1260 distinct orderings — far fewer than 9! = 362880, because swapping two identical letters doesn't make a new arrangement. MULTINOMIAL builds that division in for you.

Where FACT fits: the atom of counting

Everything in Excel's combinatorics toolkit reduces to factorials:

  • PERMUT(n, k) = n! / (n−k)! — ordered arrangements of k from n.
  • COMBIN(n, k) = n! / (k!·(n−k)!) — unordered selections.

Both are ratios of factorials, which is precisely why you should let those functions compute them rather than dividing FACT calls yourself: they avoid the overflow that a raw FACT(n) hits at 171. Think of FACT as the atom and COMBIN/PERMUT as the molecules built from it — the COMBIN & PERMUT guide picks up exactly there.

How ExcelMaster helps

Factorials are easy to call and easy to misuse — a #NUM! from an overflowed intermediate, or a probability that's off because 0! was mishandled somewhere upstream. Ask ExcelMaster "how many ways can I order these 8 items?" and it returns =FACT(8) with the answer and the reasoning. Ask "why is my probability formula returning #NUM!" and it spots the oversized factorial, and rewrites the expression with COMBIN so the giant intermediate never forms.

Frequently asked questions

How do I calculate a factorial in Excel?

Use FACT: =FACT(5) returns 120 (which is 5×4×3×2×1). It accepts a cell reference too — =FACT(A1). The input must be a non-negative number; decimals are truncated to the whole number below, and negatives return #NUM!.

Why does FACT(0) return 1 in Excel?

Because 0! is defined as 1 in mathematics — there is exactly one way to arrange zero items (the empty arrangement). The convention also keeps combination and permutation formulas consistent at their edges, where they'd otherwise divide by zero. =FACT(0) returning 1 is correct, not a bug.

Why does FACT return a #NUM! error?

Two common reasons: the input is negative (factorials aren't defined for negatives), or the result is too large — Excel can't represent a number bigger than about 1.8×10³⁰⁸, so =FACT(171) and above overflow to #NUM!. The largest factorial Excel can compute is 170!. If you only need a ratio of factorials, use COMBIN or PERMUT to avoid the overflow.

What is the difference between FACT and FACTDOUBLE?

FACT(n) multiplies every integer from n down to 1 (n!). FACTDOUBLE(n) skips every other one — the double factorial n!! — so FACTDOUBLE(7) is 7×5×3×1 = 105 and FACTDOUBLE(8) is 8×6×4×2 = 384. Use FACTDOUBLE only when a formula specifically calls for n!!.

What does MULTINOMIAL do?

MULTINOMIAL(a, b, c, …) returns (a+b+c+…)! divided by a!·b!·c!·…. It counts the distinct arrangements of items split into groups of those sizes — useful for words with repeated letters or dividing items into fixed-size groups. =MULTINOMIAL(2,3,4) returns 1260.

Tested in

Tested in: Excel 365 (Windows 11) — last verified 2026-07-26.

Related guides: Excel COMBIN & PERMUT · Excel PRODUCT · Excel POWER & SQRT · Excel ROUND · Excel SUMPRODUCT