rally > said:
im trying to perm 4 digit numbers so max permutation is 24.
i want to put a figure say 1234 in cell A1 and the resulting 24
permutation be shown in another cell(s). A2-A25 something like that.
4321, 2314, 4213 etc..
is this a very difficult procedure to learn?
....
This could be done using worksheet functions only. If you enter 1234 in A1
and would want the permutations in A2:A24, enter the following formula in
A7.
A7:
=IF(MOD(ROW(),2)=0,F6+9*(MID(F6,4,1)-MID(F6,3,1)),
CHOOSE(MOD(ROW()-1,6)/2+1,F1+TRUNC(999,INT((ROW()-1)/6)-3),
F5+90*(MID(F5,3,1)-MID(F5,2,1)),F5+99*(MID(F5,4,1)-MID(F5,2,1))))
Copy A7 and paste into A2:A24. You could then use the digits in these as
indices to permute any other array. This could be adapted for 5 and 6 item
arrays, but the formulas get long and ugly quickly. The trick here is that
the difference between any two numbers with transposed digits is a multiple
of 9.
You might also see the thread
http://groups.google.com/[email protected]
which gives some alternatives that are a bit shorter and simpler than Myrna
Larson's.