Quantcast
Channel: Excel IT Pro Discussions forum
Viewing all articles
Browse latest Browse all 11829

randomly generated competition draw with priority for players that has preference

$
0
0

(1) INPUT

player#ColumnAPreference
1player1 music
2player2
3player3 music
4player4 music
5player5 singing
6player6
7player7
8player8

(2) my original requirement was to pair the players randomly, so i used following solution. 

In E1 i have RAND() for 1000 rows (E1000),D1 I have 128 teams

In A1 used this formula

=IF(ROW()-ROW(A$1)+1>$D$1/2,"",RANK(OFFSET($E$1,ROW()-ROW(A$1)+(COLUMN()-COLUMN($A1))*($D$1/2),),$E$1:INDEX($E$1:$E$1000,$D$1)))

copy across to B1 and down as far as you might need.

Assuming you have 128 in D1 then A1:B64 will now include one each of numbers 1 to 128. Subsequent cells will be blank. Change D1 to any even number to regenerate numbers. Note: recalculation of worksheet will re-generate random numbers, hide column E if you wish

(3) So now i have a new column called PREFERENCE that has preference / interests that players have set.

I want to enhance above formula to give priority to players who have set preferences and do their pairing first with other players who have the same preferences.

If there are no players that have matching pair per perference (e.g singing in above example) then do random match.

If there are no preferences set then simply follow the logic that i have shared above for random pairing.  

Appreciate your help!!


Viewing all articles
Browse latest Browse all 11829

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>