Returns the factorial of a number. Factorial (n!) is the product of all positive integers from 1 to n. FACT(n) = n × (n-1) × ... × 2 × 1. Essential for permutations, combinations, probability calculations, and mathematical analysis.
Master the fundamentals of Excel FACT function
The FACT function returns the factorial of a number. Factorial (n!) is defined as the product of all positive integers from 1 to n: FACT(n) = n × (n-1) × (n-2) × ... × 2 × 1. Special case: FACT(0) = 1 by definition. FACT grows very rapidly: FACT(10) = 3,628,800, FACT(20) ≈ 2.43 × 10^18. If the number is not an integer, it is truncated. Essential for permutations (P(n,r) = n!/(n-r)!), combinations (C(n,r) = n!/(r!(n-r)!)), probability calculations, binomial coefficients, and mathematical analysis.
Grows exponentially
FACT(0) = 1 (by definition)
Uses only integer part
Negative numbers return error
Function-specific parameters
Function-specific return type
Calculate arrangements
Calculate selections
Probability calculations
Factorial in mathematics
Exact matching required
Returns numeric position
Handles missing text gracefully
=FACT(number)The non-negative number for which you want the factorial. If number is not an integer, it is truncated.
The factorial of the number
Description: Returns the factorial of a number
Calculate factorial of 5
Returns 120 because 5! = 5 × 4 × 3 × 2 × 1 = 120. Factorial grows very quickly.
Use FACT function in VBA
' Basic FACT in VBA
Range("C1").Value = Application.WorksheetFunction.Fact(5)
' Returns: 120
' Calculate factorial
Sub CalculateFACT()
Dim number As Integer
number = Range("A1").Value
Dim result As Double
result = Application.WorksheetFunction.Fact(number)
Range("B1").Value = result
End Sub
' Calculate permutations: P(n,r) = n!/(n-r)!
Sub CalculatePermutations()
Dim n As Integer
Dim r As Integer
n = Range("A1").Value
r = Range("A2").Value
Dim permutations As Double
permutations = Application.WorksheetFunction.Fact(n) / _
Application.WorksheetFunction.Fact(n - r)
Range("B1").Value = permutations
End Sub
' Calculate combinations: C(n,r) = n!/(r!(n-r)!)
Sub CalculateCombinations()
Dim n As Integer
Dim r As Integer
n = Range("A1").Value
r = Range("A2").Value
Dim combinations As Double
combinations = Application.WorksheetFunction.Fact(n) / _
(Application.WorksheetFunction.Fact(r) * _
Application.WorksheetFunction.Fact(n - r))
Range("B1").Value = combinations
End Sub
' Generate factorial table
Sub GenerateFactorialTable()
Dim i As Integer
For i = 0 To 10
Dim factValue As Double
factValue = Application.WorksheetFunction.Fact(i)
Range("A" & (i + 1)).Value = i
Range("B" & (i + 1)).Value = factValue
Next i
End SubCalculate arrangements
Calculate selections
Probability calculations
Factorial in mathematics
FACT returns #NUM! for negative numbers or very large values
=IF(A1>=0, FACT(A1), "Invalid")Solution: FACT only works with non-negative numbers (≥ 0). FACT of numbers > 170 may overflow. Ensure input is 0 or positive. For very large factorials, consider using approximations (Stirling's approximation).
Non-numeric input in FACT
=FACT(VALUE(A1))Solution: Ensure input is numeric. FACT requires a number. Check for text, errors, or empty cells. Use VALUE() if needed.
FACT returns error for numbers > 170
For n > 170, consider approximationsSolution: Excel FACT can handle up to FACT(170) ≈ 7.26 × 10^306. Beyond this, use approximations like Stirling's formula or break down the calculation.
FACT truncates decimal part
FACT(5.7) = FACT(5) = 120Solution: This is expected behavior. FACT(5.7) = FACT(5) = 120. FACT uses only the integer part of the number. Use INT() explicitly if needed.