Excel permutations and combinations, with or without repetition

In Excel, if order matters, use PERMUT without repetition or PERMUTATIONA with repetition. If order does not matter, use COMBIN without repetition or COMBINA with repetition. Choosing two from A, B, and C gives 6, 9, 3, and 6, respectively.

Choose a function by order and repetition

Decide whether AB and BA count as two different outcomes. Then decide whether AA is allowed. Enter the number of available types n first and the number to choose r second.

Calculation Order matters Repetition allowed Function
Permutation Yes No PERMUT
Permutation with repetition Yes Yes PERMUTATIONA
Combination No No COMBIN
Combination with repetition No Yes COMBINA

Formulas for choosing two from three types

Enter 3 in A2 for the number of types and 2 in B2 for the number chosen. Enter each formula in a separate empty cell. They return 6, 9, 3, and 6 in order. Use the argument separator for your region.

=PERMUT(A2,B2)
=PERMUTATIONA(A2,B2)
=COMBIN(A2,B2)
=COMBINA(A2,B2)

In a permutation, AB and BA are separate outcomes. There are three choices for the first position and two remaining choices for the second, giving 3×2=6. Permutations with repetition allow AA, so both positions have three choices, giving 3×3=9.

With order ignored, AB and BA count once. The combinations are AB, AC, and BC. Allowing repetition adds AA, BB, and CC, for six combinations.

Change the sample inputs and compare

Change A2 to 4 and keep B2 at 2 to get 12, 16, 6, and 10. Comparing these results with the first example shows how each count changes when you add one available type.

With repetition allowed, order ignored, and at least one available type, count ordinary combinations of r positions from n+r−1. Set A2 to 3 and B2 to 5, then use the formula below to get 21.

=COMBIN(A2+B2-1,B2)

Check invalid inputs and large counts

Use nonnegative integers that make sense for the problem. A positive n works for the comparison here. For selections without repetition, r cannot exceed n. Excel can truncate decimal arguments, so check the original input values.

Out-of-range arguments can produce #NUM!, and arguments that cannot be treated as numbers can produce #VALUE!. Very large counts can lose their final digits because Excel has limited numeric precision.

Microsoft’s PERMUT function reference

Microsoft’s PERMUTATIONA function reference

Microsoft’s COMBIN function reference

Microsoft’s COMBINA function reference