View Single Post
  #7   Report Post  
DOR
 
Posts: n/a
Default Getting Excel to Calculate All Combinations of a Set of Data?

It seems that people cannot determine whether you are looking for
permutations or combinations ...

If you have the digits 1 to 5, 120 different *permutations* can be
generated, consisting of the 5 digits arranged in different sequences,
e.g.

12345
12354
12435
12453
..
..
etc. down to
54321


These digits will all add up to the same value of 15.

On the other hand, you can generate 10 *combinations* of 2 digits each
from this set of digits, e.g.

12
13
14
15
23
24
25
34
35
45

or 10 combinations of 3 digits each

123
124
125
134
135
145
234
235
245
345

or 5 combinations of 4 digits each

1234
1235
1245
1345
2345

or 1 combination of 5 digits

12345

or 5 "combinations" of 1 digit each 1,2,3,4,5 (if needed!), making a
total of of 31 *combinations* of from 1 to 5 digits.

The combinations will tend to add up to different numbers, although
some combinations will add up to the same value as others, e.g. 34 and
25.

What people need to know in order to help you, is, when you have 5
objects, do you want to generate all 120 *permutations* of the 5
objects or all 31 *combinations* of size 1 to 5, as described above, or
a subset of combinations of N objects each. Permutations are all about
sequence; combinations are all about selecting subsets, sequence is not
important. In answering, you need to use the words permutations and
combinations as they are used above.

If it is permutations you want, look here

http://www.j-walk.com/ss/excel/tips/tip46.htm