Microsoft KB Archive/42615

Excel Function Macro to Calculate Combination PSS ID Number: Q42615 Article last modified on 06-15-1993 PSS database name: W_eXceL

2.00 2.01 2.10 3.00

WINDOWS

Summary:

The following macro calculates the combination of a given number of items for a given distribution:

A1: Combination A2: =ARGUMENT(“items”) A3: =ARGUMENT(“order”) A4: =FACT(items) A5: =FACT(order)*FACT(items-order) A6: =A4/A5 A7: =RETURN(A6)

A combination is a mathematical method of finding the maximum number of ways that a number of items can be placed into a distribution. The main difference between a combination and a permutation is that the order of the items placed within a combination does not matter.

Therefore, if you want to find out the total number of different ways that you can pull 3 jelly beans out of a bag of 10 (you don’t care in what order you eat the jelly beans), you would find the combination of 50 items taken 3 ways (which is 120).

This functionality has been included in versions of Microsoft Excel later than 3.0 and the macro is not required.

For additional information, query on the words:

Query and Excel and Macro and Calculate and Permutation

Additional reference words: 2.0 2.00 2.01 2.1 2.10 3.0 3.00

Copyright Microsoft Corporation 1993.