The FACT function returns the factorial of a non-negative integer, which is the product of all positive integers up to that number. It is used in combinatorics, probability, and counting arrangements.
=FACT(number)What does FACT do?
The FACT function calculates the factorial of a number, written as n!. A factorial multiplies a number by every positive integer below it: FACT(5) equals 5 × 4 × 3 × 2 × 1 = 120. Excel handles the multiplication for you, so you can focus on the problem rather than the arithmetic.
Factorials appear whenever you count arrangements or selections: how many ways a team can finish a race, how many unique passwords a set of characters can create, or how many possible committees can be formed from a group. Instead of building long multiplication chains, you write a single formula.
For office workers and students, FACT saves time and reduces errors in scheduling, quality sampling, and probability exercises. It also pairs naturally with other Excel functions such as PERMUT and COMBIN to solve real business and classroom problems quickly.
When to use FACT
- Counting the number of ways to arrange items in a sequence, such as ranking contestants or ordering tasks.
- Calculating permutations and combinations for team selection or quality inspection sampling.
- Solving probability problems that involve factorial notation in statistics courses.
- Estimating the number of unique passwords or codes from a fixed character set.
- Checking combinatorial results in research, logistics, or operations planning.
FACT syntax
=FACT(number)| Argument | Required? | What to enter |
|---|---|---|
number | Required | The non-negative integer whose factorial you want. If you enter a decimal, Excel truncates it to an integer before calculating. Example: =FACT(5) returns 120. |
What it returns: A numeric value: the factorial of the given number. For example, =FACT(5) returns 120. If the number is negative, FACT returns the #NUM! error.
FACT examples
1 Basic factorial of a small number
This example shows the simplest use of FACT. The goal is to find how many ways 5 distinct items can be arranged. The formula =FACT(B2) takes the number in cell B2 (5) and multiplies 5 × 4 × 3 × 2 × 1. It returns 120, the number of possible orderings.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Items | Count | |||
| 2 | Books | 5 | 120 | ||
| 3 |
2 Factorial for a race finishing order
Here you want to know how many different finishing orders are possible for 6 runners. The formula =FACT(B2) uses the runner count in B2 and returns 720. This tells you there are 720 unique ways the race could end, which is useful for event planning and probability discussions.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Event | Runners | |||
| 2 | Sprint final | 6 | 720 | ||
| 3 |
3 Factorial in a password strength estimate
A security team wants to estimate how many unique 4-character passwords can be made from 4 distinct symbols when each symbol is used exactly once. The formula =FACT(B2) returns 24. This is a simplified illustration; real password counts usually allow repetition and use exponentiation, but FACT shows the arrangement count clearly.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Character set | Symbols | |||
| 2 | Four unique symbols | 4 | 24 | ||
| 3 |
4 Factorial for scheduling tasks
A project manager has 7 independent tasks that can be done in any order. The formula =FACT(B2) returns 5040, the number of possible task sequences. This helps the team understand the scale of scheduling options before applying constraints.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Project | Tasks | |||
| 2 | Website launch | 7 | 5040 | ||
| 3 |
5 Factorial in a quality sampling scenario
A quality inspector wants the factorial of the sample size to use in a larger combinatorial calculation. With a sample size of 8, the formula =FACT(B2) returns 40320. This value can then be used in formulas for permutations or combinations, saving manual multiplication.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Batch | Sample size | |||
| 2 | Inspection lot | 8 | 40320 | ||
| 3 |
Common FACT errors and how to fix them
| Error | Why it happens | How to fix it |
|---|---|---|
| #NUM! | The number argument is negative. Factorials are not defined for negative integers in Excel's FACT function. | Use a non-negative number. If your data may contain negatives, wrap the formula with a check such as =IF(B2<0,"Invalid",FACT(B2)). |
| #VALUE! | The number argument is text that cannot be converted to a number, such as a word or a cell containing only spaces. | Ensure the cell contains a number. Remove stray characters or use VALUE() to convert numeric text. |
| #NUM! (large result) | The factorial is too large for Excel to represent. FACT(171) and above exceed Excel's numeric limit. | Use smaller numbers or work with logarithms of factorials for very large values. |
| Wrong result due to decimals | FACT truncates decimal numbers to integers, so FACT(5.9) returns 120, not a fractional factorial. | Round or truncate intentionally before using FACT, or confirm that integer input is appropriate. |
Tips for using FACT
- Remember that FACT(0) returns 1 by definition, which is useful in combinatorial formulas.
- Use FACT together with PERMUT and COMBIN to solve arrangement and selection problems without manual multiplication.
- If you need the factorial of a cell that might be empty, Excel treats an empty cell as 0, so FACT returns 1; add a check if that is not desired.
- For large factorials, consider whether you need the exact value or just a ratio; ratios often simplify before calculating.
- Keep input cells formatted as numbers to avoid #VALUE! errors from text entries.
Frequently asked questions
What does the FACT function do in Excel?
FACT returns the factorial of a non-negative integer, which is the product of all positive integers up to that number. For example, FACT(5) returns 120.
Can FACT handle negative numbers?
No. FACT returns the #NUM! error for negative numbers because factorials are not defined for negatives in this function.
What is FACT(0)?
FACT(0) returns 1. By mathematical convention, the factorial of zero is 1, and Excel follows this rule.
Does FACT work with decimals?
Yes, but it truncates the decimal to an integer first. FACT(5.9) calculates as FACT(5) and returns 120.
How large a number can FACT handle?
Excel can calculate factorials up to FACT(170). FACT(171) and above return #NUM! because the result exceeds Excel's numeric limit.
Related functions
Every example on this page was recalculated by SheetSkill’s spreadsheet engine. FACT reference