Excel - randomization with certain criteria

  • Thread starter Thread starter Alen Paliska
  • Start date Start date
A

Alen Paliska

I'm trying to develop a sheet that creates six random number from given list
of data. I've already found the solution for that but there are some
conditions that has to be fulfilled and I don't know how to solve it, so I
was hoping that somebody can help me.
A little explanation of the problem: on international amateur boxing
championship, computer has to automatically draw the list of 1 referee
(judge in the ring) and 5 judges (judges around the ring) from the list of
available judges, but:
1. referee and judges must not be from the countries of participants in the
ring and 2. referee can not be in the ring twice in the roll
If somebody know answer to this problem, I would appreciate it.
Thank you in advance.
 
The two methods normally used are

1) Eliminate the inelligable judges before picking tthe random judge

2) Keep on picking judges until one that meets the requirements.
 
yes, it's true, but each draw has to be done only once, and to be completely
honest, I'm not that experienced in Excel VBA to develop it on my own... :(
 
With random number one draw is usually defined as picking until a valid item
is drawn.

If you would write code to pick a lottery number.The game requires you to
pick three number 1-10. You can only have each number picked once.


A = Int((9 * Rnd(x)) + 1)

B = -1
Do While B <> A

B = Int((9 * Rnd(x)) + 1)
Loop


C = -1
Do While (C <> A) And (C <> B)

C = Int((9 * Rnd(x)) + 1)
Loop
 
Back
Top