How to use the FACT function
What is the FACT function?
The FACT function returns the factorial of a number.
What is the factorial of a number?
The factorial of a number n is the product of all positive integers less than or equal to n, and is represented by n!
The factorial of a number n is defined as:
n! = n * (n-1) * (n-2) * ... * 3 * 2 * 1
In other words, the factorial of a number n is the product of all positive integers less than or equal to n.
Some examples:
1! = 1
2! = 2 * 1 = 2
3! = 3 * 2 * 1 = 6
4! = 4 * 3 * 2 * 1 = 24
5! = 5 * 4 * 3 * 2 * 1 = 120
0! = 1
The factorial function grows very quickly as n increases. Factorials are useful in combinatorics for counting permutations and combinations.
How to calculate combinations using factorials?
The formula for combinations is:
C(n, r) = n! / (r! * (n-r)!)
Where:
n = Total number of objects
r = Size of the subset we choose
For example, say we have 5 fruits: apple, banana, orange, mango and peach. We want to calculate how many combinations of 3 fruits there are from this set of 5 fruits.
n = 5 (total fruits) r = 3 (size of subset)
C(5, 3) = 5! / (3! * (5-3)!) = 120 / (6 * 2) = 10
How to calculate permutations using factorials?
For example, ordering 3 letters out of the alphabet.
The formula for permutations is:
P(n, r) = n! / (n - r)!
Where:
n = Total number of objects
r = Number of objects being arranged
For example, say we want to find how many ways we can arrange 3 letters from the alphabet.
n = 26 (total letters) r = 3 (letters we are arranging)
P(26, 3) = 26! / (26 - 3)! = 26! / 23! = 15600
What are permutations?
A permutation is a way of arranging a set of elements in a specific order. For example, if you have three letters A, B, and C, you can arrange them in six different ways: ABC, ACB, BAC, BCA, CAB, and CBA.
Each of these arrangements is called a permutation of the three letters. The order of the objects matters in a permutation, so ABC and BAC are considered different permutations.
The PERMUT and PERMUTATIONA functions are in the Statistical category
What are combinations?
A combination is a way of selecting items from a collection where the order of selection does not matter.
For example, if you have three fruits, say an apple, an orange, and a pear. There are three combinations of two that can be drawn from this set:
- apple and a pear
- apple and an orange
- pear and an orange
The COMBIN and COMBINA functions are in the Math and trigonometry category.
Formula in cell C3:
Example, 3! = 3*2*1 = 6
Table of Contents
1. FACT Function Syntax
FACT(number)
2. FACT Function Arguments
number | Required. The number equal to or larger than 0 (zero) for which you want to calculate the factorial. |
If number is not an integer, it is truncated.
Returns an error if the number argument is a text value.
3. FACT Function example
The FACT function is useful if you want to calculate the number of permutations of a given set of elements.
The following set has three elements: [A, B, C].
3! = 3*2*1 = 6. You can rearrange [A, B, C] in six different permutations.
1, [A, B, C]
2, [A, C, B]
3, [B, A, C]
4, [B, C, A]
5, [C, A, B]
6, [C, B, A]
'FACT' function examples
Chris asks: Maximum Number Allowed is 4 digit and the number is from 0 to 9. After I fill in […]
This blog post describes how to create permutations, repetition is NOT allowed. Permutations are items arranged in a given order meaning […]
This blog post demonstrates a custom function (UDF) that creates permutations. Repetition is allowed. The custom function lets you specify the […]
Functions in 'Math and trigonometry' category
The FACT function function is one of many functions in the 'Math and trigonometry' category.
How to comment
How to add a formula to your comment
<code>Insert your formula here.</code>
Convert less than and larger than signs
Use html character entities instead of less than and larger than signs.
< becomes < and > becomes >
How to add VBA code to your comment
[vb 1="vbnet" language=","]
Put your VBA code here.
[/vb]
How to add a picture to your comment:
Upload picture to postimage.org or imgur
Paste image link to your comment.
Contact Oscar
You can contact me through this contact form