FACT function

FACT calculates the factorial of a number (n!), returning the product of all positive integers from 1 to n; use it for permutations and combinations.

=FACT(number)

Generate a FACT formula

Describe what you need. The generator will reach for FACT where FACT is the right tool, and tell you when it is not.

How to get a better answer
  • Name your columns by letter and by header: "column F (Net Value)" beats "the amount column".
  • State every condition, including the negatives — "not cancelled" changes the formula's shape.
  • Say where the data starts if it is not row 1, and whether it will grow.
  • Check the settings above match your spreadsheet: the wrong argument separator is a syntax error on your machine.

Arguments

How FACT reads its arguments
numberrequiredFACT
ArgumentRequiredDescription
numberRequiredA non-negative integer (0–170 in most spreadsheets); decimals are typically truncated or cause #VALUE! error, and negative numbers produce #NUM! error.

Returns

A positive integer representing n!, the product of all integers from 1 to n; FACT(0) returns 1 by convention.

Availability

Excel: All · Google Sheets: Supported

Worked examples

1. Calculate permutations of critical-priority tickets

Ticket IDPriorityAgentCSAT
TK-001CriticalJohn Smith5
TK-002CriticalSarah Chen4
=FACT(2)

Result: 2

With 2 critical tickets in queue, FACT(2) returns 2! = 2 × 1 = 2, representing the two different orderings in which to process or assign them.

2. Calculate all possible shift arrangements for 5 agents

Agent NameTickets Assigned
John Smith12
Sarah Chen14
Mike Johnson9
Emma Davis11
David Lee10
=FACT(5)

Result: 120

With 5 agents available, 5! = 5 × 4 × 3 × 2 × 1 = 120 unique ways to schedule or arrange them across work rotations.

3. Calculate combinations: choose 2 agents from 5 for a project team

Agent Name
John Smith
Sarah Chen
Mike Johnson
Emma Davis
David Lee
=FACT(5)/(FACT(2)*FACT(3))

Result: 10

Using the combination formula C(5,2) = 5!/(2!×3!) = 120/12 = 10, there are exactly 10 unique 2-person teams you can form from the 5 agents.

Common errors

Which FACT error are you seeing?
FACT returned an error#NUM!
Use ABS() to convert to positive, or validate inputs first: =IF(A1<0,"Invalid",FACT(A1)) to reject negative agent counts.
#VALUE!
Ensure the argument is numeric; use COUNTIF to extract counts first: =FACT(COUNTIF(B:B,"Critical")) to count tickets by priority.
#NUM!
Restrict inputs to 0–170; for larger values, use approximations like Stirling's formula or external computational tools.
ErrorWhy it happensHow to fix it
#NUM!FACT receives a negative number (e.g., FACT(-3)); factorials are mathematically undefined for negative integers.Use ABS() to convert to positive, or validate inputs first: =IF(A1<0,"Invalid",FACT(A1)) to reject negative agent counts.
#VALUE!FACT receives a text string instead of a number (e.g., FACT("Critical") or FACT(agent_name)).Ensure the argument is numeric; use COUNTIF to extract counts first: =FACT(COUNTIF(B:B,"Critical")) to count tickets by priority.
#NUM!FACT receives a number greater than 170; most spreadsheets cap factorials at 170 due to the astronomical size of the result.Restrict inputs to 0–170; for larger values, use approximations like Stirling's formula or external computational tools.

Tips and when to use something else

  • Factorials explode in size: FACT(10) = 3,628,800 and FACT(20) exceeds 2 trillion. Even modest inputs quickly produce unmanageable results.
  • Use PRODUCT for arbitrary multiplication ranges; PRODUCT is more flexible. FACT specifically computes n × (n−1) × ... × 1 in strict order.
  • Combine FACT with IF for conditional logic: =IF(priority="Critical",FACT(5),FACT(3)) calculates different factorials based on ticket severity.
  • Most spreadsheets limit FACT to arguments 0–170. Use QUOTIENT to safely divide large factorial results in permutation formulas without overflow errors.

Frequently asked questions

What's the maximum number I can use with FACT?
FACT works with integers 0 to 170 in most spreadsheets. Inputs above 170 return #NUM! error. FACT(0) returns 1 by mathematical convention; negative numbers are always undefined.
How do I calculate combinations of agents or tickets using FACT?
Apply the combination formula C(n,k) = n! / (k! × (n-k)!). Example: to select 2 agents from your 5-person team, use =FACT(5)/(FACT(2)*FACT(3)) = 10 possible pairings.
Why use FACT instead of PRODUCT?
FACT calculates n! directly (1 × 2 × 3 × ... × n), while PRODUCT multiplies any arbitrary range of cells. Use FACT when you specifically need a factorial; PRODUCT is better for flexible range multiplication.
Can I calculate factorials of decimal or negative numbers?
No; FACT only accepts non-negative integers. Decimals typically truncate or cause #VALUE! error, and negative numbers always produce #NUM!. Use INT or TRUNC to round decimals, or validate with IF first.

Need a different formula?

The full generator is not scoped to one function — describe any spreadsheet problem and it will pick.

Open the formula generator

Reviewed 2026-09-17