I need a macro that will put a column of 40 numbers in random order
1
2
3
4
5
6
to
3
6
1
3
5
4
I need a macro that will put a column of 40 numbers in random order
1
2
3
4
5
6
to
3
6
1
3
5
4
One (non-macro) approach would be to use
=RAND() in column B, copy and paste values, and then:
EITHER: sort columns A & B using the values in column B.
OR use this formula in C1, copied down:
=INDEX($A$1:$A$40,MATCH(SMALL($B$1:$B$40,ROWS($C$1:C1)),$B$1:$B$40,0))
Glenn
None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.
Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh
You're implying no repeats, but you haven't stated that.
Does it have to be a macro?
If not try this
Put your 40 numbers in A1:A40
in B1:B40 put =RAND()
in C1:C40 put =INDEX(A$1:A$40,MATCH(SMALL(B$1:B$40,ROW()),B$1:B$40,0))
Your output is in column C. 40 non-repeated random numbers.
UPDATE: Damn! 1 minute late :-(
Regards
Special-K
Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.
Thanks guys!!! Exactly what I need!!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks