Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I need to put the numbers from 1 to 54 in a list where each number is randomly
selected. A lot like choosing bingo balls, but once the ball is chosen, it can't be chosen again. How do I put 1 to 54 in random order with no duplicates and none missing? -- Regards, Fred |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Sun, 1 Oct 2006 16:44:36 -0600, "Fred Smith" wrote:
I need to put the numbers from 1 to 54 in a list where each number is randomly selected. A lot like choosing bingo balls, but once the ball is chosen, it can't be chosen again. How do I put 1 to 54 in random order with no duplicates and none missing? See this MSKB article: http://support.microsoft.com/kb/213290/en-us --ron |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() The macro gets stuck in an endless loop if I try to get more than 85 percent of the range. See if this usual response to this type of question is what you want. Put the numbers 1 to 54 in column A. Enter =rand() in B1. Autofill to B54. With the cursor in B1 sort. Column A will be in a different order each time you sort. -- skatonni ------------------------------------------------------------------------ skatonni's Profile: http://www.officehelp.in/member.php?userid=4186 View this thread: http://www.officehelp.in/showthread.php?t=1216057 Posted from - http://www.officehelp.in |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Mon, 2 Oct 2006 06:13:15 +0530, skatonni
wrote: The macro gets stuck in an endless loop if I try to get more than 85 percent of the range. See if this usual response to this type of question is what you want. Put the numbers 1 to 54 in column A. Enter =rand() in B1. Autofill to B54. With the cursor in B1 sort. Column A will be in a different order each time you sort. Yes, I just noticed that loop issue. Your method seems simple and effective. --ron |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Just one way to quickly set it up using formulas ..
Assuming the numbers 1-54 are listed in A1:A54 Put in B1: =RAND() Put in C1: =INDEX(A:A,RANK(B1,$B$1:$B$54)) Select B1:C1, copy down to C54. (Hide away col B) C1:C54 will return a random scramble of the numbers within A1:A54 (or whatever's within A1:A54) . Re-generate the random scramble by pressing F9. -- Max Singapore http://savefile.com/projects/236895 xdemechanik --- "Fred Smith" wrote in message ... I need to put the numbers from 1 to 54 in a list where each number is randomly selected. A lot like choosing bingo balls, but once the ball is chosen, it can't be chosen again. How do I put 1 to 54 in random order with no duplicates and none missing? -- Regards, Fred |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Theoretically, dups are still possible using RAND but highly unlikely with a
small distribution. Biff "Max" wrote in message ... Just one way to quickly set it up using formulas .. Assuming the numbers 1-54 are listed in A1:A54 Put in B1: =RAND() Put in C1: =INDEX(A:A,RANK(B1,$B$1:$B$54)) Select B1:C1, copy down to C54. (Hide away col B) C1:C54 will return a random scramble of the numbers within A1:A54 (or whatever's within A1:A54) . Re-generate the random scramble by pressing F9. -- Max Singapore http://savefile.com/projects/236895 xdemechanik --- "Fred Smith" wrote in message ... I need to put the numbers from 1 to 54 in a list where each number is randomly selected. A lot like choosing bingo balls, but once the ball is chosen, it can't be chosen again. How do I put 1 to 54 in random order with no duplicates and none missing? -- Regards, Fred |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
This caveat also applies to the "standard" sort routine <g
-- Max Singapore http://savefile.com/projects/236895 xdemechanik --- "Biff" wrote in message ... Theoretically, dups are still possible using RAND but highly unlikely with a small distribution. Biff |
#8
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
It does but with the sort routine normally you're pulling the numbers
directly from the source column so there's no chance of dupes if you write the proper formula. Biff "Max" wrote in message ... This caveat also applies to the "standard" sort routine <g -- Max Singapore http://savefile.com/projects/236895 xdemechanik --- "Biff" wrote in message ... Theoretically, dups are still possible using RAND but highly unlikely with a small distribution. Biff |
#9
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
It's the same "source" here, ie the helper col with: =RAND() filled down
correspondingly to match the source col. I don't know what you meant by: the proper formula .. -- Max Singapore http://savefile.com/projects/236895 xdemechanik --- "Biff" wrote in message ... It does but with the sort routine normally you're pulling the numbers directly from the source column so there's no chance of dupes if you write the proper formula. Biff |
#10
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() Max wrote: This caveat also applies to the "standard" sort routine <g I suppose the best solution would be to have the worksheet functions do the bulk of the work then use a macro to copy the values into the table after checking for the extremely unlikely duplicates. If duplicates are found then the macro could just re-run itself. This also would avoid the problem of the random 1 to 54 values in the table changing everytime the worksheet calculates anything. A macro can be re-run from within itself when a certain condition is met can't it? Ken Johnson |
#11
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Ken,
Being non-vba proficient, don't think I'm in a position to comment. My suggestion to Fred was just a formula variant to the "standard" way described in skatonni's response, which provides a way to get a new random scramble of the source items within A1:A54 consigned to merely pressing F9. That's all there is to it. -- Max Singapore http://savefile.com/projects/236895 xdemechanik --- "Ken Johnson" wrote in message ps.com... Max wrote: This caveat also applies to the "standard" sort routine <g I suppose the best solution would be to have the worksheet functions do the bulk of the work then use a macro to copy the values into the table after checking for the extremely unlikely duplicates. If duplicates are found then the macro could just re-run itself. This also would avoid the problem of the random 1 to 54 values in the table changing everytime the worksheet calculates anything. A macro can be re-run from within itself when a certain condition is met can't it? Ken Johnson |
#12
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks, Max. That's exactly what I wanted.
I did a simple sum of column A and C to check for duplicates. I know in theory this could still mask an error, but it was good enough for my purposes. I also enjoyed your discussion with Biff, but my needs aren't that specific. I can easily manually fix any error that creeps in. -- Regards, Fred "Max" wrote in message ... Just one way to quickly set it up using formulas .. Assuming the numbers 1-54 are listed in A1:A54 Put in B1: =RAND() Put in C1: =INDEX(A:A,RANK(B1,$B$1:$B$54)) Select B1:C1, copy down to C54. (Hide away col B) C1:C54 will return a random scramble of the numbers within A1:A54 (or whatever's within A1:A54) . Re-generate the random scramble by pressing F9. -- Max Singapore http://savefile.com/projects/236895 xdemechanik --- "Fred Smith" wrote in message ... I need to put the numbers from 1 to 54 in a list where each number is randomly selected. A lot like choosing bingo balls, but once the ball is chosen, it can't be chosen again. How do I put 1 to 54 in random order with no duplicates and none missing? -- Regards, Fred |
#13
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You're welcome, Fred !
Thanks for the feedback .. -- Max Singapore http://savefile.com/projects/236895 xdemechanik --- "Fred Smith" wrote in message ... Thanks, Max. That's exactly what I wanted. I did a simple sum of column A and C to check for duplicates. I know in theory this could still mask an error, but it was good enough for my purposes. I also enjoyed your discussion with Biff, but my needs aren't that specific. I can easily manually fix any error that creeps in. -- Regards, Fred |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Displaying all combinations of a range of numbers | Excel Worksheet Functions | |||
Non updatable Unique Random Number | Excel Worksheet Functions | |||
How I can see distict numbers among range of numbers? | Excel Discussion (Misc queries) | |||
keyboard command used to select a range of nonadjacent cells? | Excel Discussion (Misc queries) | |||
Conversion | Excel Worksheet Functions |