In this article, you will learn how to calculate the factorial of a number in Excel and how to use the Excel function FACT.
Factorial is a mathematical operation that calculates the product of an integer and all the positive integers below it. It is represented by an exclamation mark (!) after the number. Factorials are useful in solving problems related to counting arrangements, combinations, and permutations.
FACT function to calculate factorial
Excel FACT function calculates the factorial of a number. The general expression of factorial is n! = n x (n-1) x (n-2) x … x 2 x 1.
In Excel, you’ll find the factorial function as one of its built-in features, located under the Maths functions category. This function works in a similar way to the mathematical factorial operation you’re familiar with.
To calculate the factorial of a number in Excel:
- Select a cell and type =FACT(B4)
- Type a number or select a cell you want to calculate the factorial of
- Press Enter
For instance, the factorial of 5 is equal to 5! = 5x4x3x2x1 = 120. The formula =FACT (5) calculates the factorial of 5.
Things to remember when calculating factorial in Excel:
- The Factorial of a negative number such as -1!, -2!, etc is undefined.
- FACT function returns the #NUM error for negative numbers.
- You can use Stirling’s Approximation to get the approximate value in Excel.
Different way to calculate factorial
Another way to calculate factorial in Excel is to use an approximation formula called Stirling’s Approximation. This approximation of the factorial was invented by the Scottish mathematician James Stirling. Its mathematical expression is (n/e)^n√(2*π*n).
For instance, we can calculate the factorial of 4 with the formula =SQRT(2*PI()*4)*(4/EXP(1))^4 using the Stirling Approximation. We get approximately 23.506.
Solving real-life problems with factorial in Excel
We can use the factorial formula on various problems in daily life. To better understand, let’s solve a few problems and see how we can use Excel to solve real-world factorial problems.
- Factorial Problem 1: In how many ways can 6 people be arranged in a row? This is calculated by 6x5x4x3x2x1 = 6!. We can calculate this directly in Excel with the formula =FACT(6).
- Factorial Problem 2: What is the number of possible ways to arrange a selection of 3 people? The answer to such a problem is 6x5x4 = 120. We can formulate this with the formula n!/(n-k)!. In this formula, n=6 and k=3. Using Excel, we calculate this with the formula =FACT(6)/FACT(6-3).
Double Factorial
The FACTDOUBLE function in Excel calculates the double factorial of a number. The general mathematical expression is n!! = n x (n-2) x (n-4) x… for the double factorial. For example, 5!! is equal to 5x3x1 = 15. So, the formula =FACTDOUBLE (5) calculates double factorial of 5.