View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
JB JB is offline
external usenet poster
 
Posts: 115
Default Randomize list of integers beteen 1-x with no repeats

Sven,
I was thinking that there might be a loop of some sort with an If statement
that compares the newly generated random value to the previous value in a
reference column, and if it is equal to the previous value, it generates
another random value until it finds one that is not equal...then moves on. Is
there a kernel of possibility there? Each successive value would...oh, I'd be
back in the same boat with repeated values wouldn't I.

"Sven Pran" wrote:


"JB" wrote in message
...
I need to randomly select names (can be represented by integers) from a
list, to create a new list of those names, using all the names with no
repeats. This is a duty roster that changes monthly. I want to change the
order each month using all the names. I have tried to do this with RAND
and
Data Analysis Tools, but can't get rid of the repeats or use all the
numbers.
The pattern option in the Data analysis Tools insists upon repeating
values.
Ideally, I would like to not have anyone on last month's list in the same
position on this month's list, but one hurdle at a time. any ideas?
Thanks!


You have already had answers to your first problem.

However:

"I would like to not have anyone on last month's list in the same
position on this month's list".

This requirement conflicts with the request for a random shuffle!
The probability that nobody will be in the same position twice is
far less than 50%, I believe it is in the order of 35% (I can't be
bothered to figure it out again).

(You might be interested to learn that a similar condition with the
main German cipher system during WW2 resulted in a deficiency
that led the cipher to be broken by first the Poles and then the
British intelligence services)

regards Sven