ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How to show all the possible combination of a set of numbers? (https://www.excelbanter.com/excel-worksheet-functions/70812-how-show-all-possible-combination-set-numbers.html)

[email protected]

How to show all the possible combination of a set of numbers?
 
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


Max

How to show all the possible combination of a set of numbers?
 
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 ..
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
wrote in message
oups.com...
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




Fei

How to show all the possible combination of a set of numbers?
 
Thank you so much, Max! I will try at once :-)

Fei


Max

How to show all the possible combination of a set of numbers?
 
You're welcome, Fei.
Thanks for posting back ..
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Fei" wrote in message
oups.com...
Thank you so much, Max! I will try at once :-)

Fei





All times are GMT +1. The time now is 08:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com