Excel random number question

StellenboschStudent

Expert Member
Joined
Nov 24, 2007
Messages
2,067
Reaction score
1
Location
Geordie land
I have 60 cells and I want to randomly divide them into 12 groups.
So, I tried =randbetween(1,12) and this does give me almost what I am looking for, except that it doesn't divide it equally. There aren't 5 of each, but a random amount. So, is there some method to get 12 random groups with 5 entries each?
 
write a vba macro. For each cell, generate random number between [1,12] and if said column is not full, place it in that one. If the column is full, regenerate until you get a non-full column. If all columns are full, you're done but you won't reach that state because you'll be done iterating through the cells.
 
Last edited:
for each cell generate a random number.
then rank the random numbers.
use the smallest 5 random numbers for group 1, next smallest for group 2 etc.
 
Top
Sign up to the MyBroadband newsletter
X