Permutation result

M

mimi

Hi,

I was tryinig to work on Permutation Combination keys in excel.
I wanted to know how many combinations of 4 letters can be generated and
what are they.

Problem Example:
1112

result (in different cells):
1112
1121
1211
2111

any help?
 
B

Bernard Liengme

Do you mean any 4 letters (from A to Z) or four known letters like A,B,C,D?
If the first, then the answers is 26*25*24*23 if they are all different;
that is 358800
and would take up a lot of space

If the second, then the answer, without duplicates, is 24

This question is asked a lot: search Google Groups with "Excel Permutations"
and you will get about 3K of hits. Be prepared for VBA code.
best wishes
 
M

Max

.. how many combinations of 4 letters can be generated & what are they

One easy play to generate the combinations
is to use Myrna Larson's power subroutine ..

Take away this implemented sample from my archives:
http://www.savefile.com/files/518493
MyrnaLarson_Combination_Permutation.xls
(full details inside, ready to run)

In the sample file,

In Sheet1,
1. Enter the letter C or P in A1
(C = combinations, P = permutations),
eg enter: C (in your example, it's combinations)

2. Enter the number of items involved in A2,
eg enter: 4 (in your case, it's 4 items)

3. Enter/List the N items in A3 down
eg in A3:A6, enter the 4 items: 1,1,1,2

4. Select A1 (this cell selection is required),
then click the button "ListPermutations"
to run the sub ListPermutations

5. The results will be written to a new sheet (just to the left),and wrap*
in a zig-zag manner until all combinations are exhausted
*if it exceeds the rows limit of 65536 in xl97 to xl2003

--------
Go easy when you "ramp up" the generation
(increasing picks on increasing N values)

--
Max
Singapore
http://savefile.com/projects/236895
Downloads:18,600 Files:362 Subscribers:60
xdemechanik
---
 
M

mimi

Hi Bernard,
thanks for the post.

your second solution is what i'm looking for.
i've been googling it all day..all comes with the programming language which
i dun understand at all :D
haha
it's ok though..thanks a lot.

I'll dig further into it..

c ya ;)
 

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