How to show all the possible combination of a set of numbers?

J

joey_qf

Hi guys:

I am trying to show the all possible combinations of a set of numbers
in Excel, in my case I think permutations are more appropriate to use.
Could you please anyone give me some hints?
For example: there are three numbers 1, 2, 3
I want to show results like:
1, 2, 3
1, 3, 2
2, 1, 3
2, 3, 1
3, 2, 1
3, 1, 2

The functions in Excel available only give the total number, but I want
to see these combinations!

Thanks do much!

Fei
 
M

Max

Try this sample implementation* of Myrna Larson's power routine:
http://savefile.com/files/1635536
MyrnaLarson_Combination_Permutation.xls
*Full details inside

(Save the file to your harddisk first, then open the file from there.)

In Sheet1,

Enter in A1: P
Enter in A2: 3 (that's the number of items to be permutated)
List the items, i.e. the 3 numbers in A3:A5 : 1,2,3
*Select A1*, then just click the button "ListPermutations" to run

The results below will be written to a new sheet
(to the left):

1, 2, 3
1, 3, 2
2, 1, 3
2, 3, 1
3, 1, 2
3, 2, 1

Go easy and start small on the number of items for permutation/combination.
The number of permutations/combinations to be listed increases very fast
with the number of items involved. Do a sanity check first using the
functions PERMUT / COMBIN ..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top