How do I sort different combination of a 4 digits number

D

didi

I have entered datas in an excel sheet. So many!
They are all 4 digits numbers. Now I would like excel to automatically sort
for me the different combinations for each number.
For example: from 0 to 9 I came up with the number 2-3-5-6 that has 24 ways
to be permuted. These are the combinations I would like excel to sort
automatically for me.
Thanks.
 
J

Jim Cone

Give this a gander...
http://www.j-walk.com/ss/excel/tips/tip46.htm
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"didi" <[email protected]>
wrote in message
I have entered datas in an excel sheet. So many!
They are all 4 digits numbers. Now I would like excel to automatically sort
for me the different combinations for each number.
For example: from 0 to 9 I came up with the number 2-3-5-6 that has 24 ways
to be permuted. These are the combinations I would like excel to sort
automatically for me.
Thanks.
 
E

Edward

This is not elegant at all, but here's what I did in my attempt to
find a non-VB solution:

Number in question is in A1. I filled out a range with all possible
permuations of a 4 digit number, digits numbered 1 through 4, say
B1:B24:

1234
1243
1324
....
....
4213
4231
4312
4321

Then I put this formula in C1 and dragged down to C24 (not elegant -
array entered w/ ctrl-shift-enter):

{=SMALL(--(MID($A$1,--MID($B$1:$B$24,1,1),1)&MID($A$1,--MID($B$1:$B
$24,2,1),1)&MID($A$1,--MID($B$1:$B$24,3,1),1)&MID($A$1,--MID($B$1:$B
$24,4,1),1)),ROW(A1))}

C1:C24 is now your list of all 24 possible permutations of the number
including repeats in ascending order.
 

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