Sweedler
Board Regular
- Joined
- Nov 13, 2020
- Messages
- 132
- Office Version
- 365
- Platform
- Windows
Hello
I have a list of names that need to have several formulas carried out on them, but that formula needs to also be based on the amount of names. The names are in column E of my document, and a list of numbers (from 1 to100) in column A. What I want to do is group the names into random groups of either 3-4 or 5. And then I would ideally need to be able to do the same thing again, but trying to make sure that the groups are not the same as they were last time.
What I did before trying to do this was VBA was the following:
For each name: in column C: =IF(E2="","",RANDBETWEEN(100,900))
For each name: in column D: =IFERROR(9+RANK.EQ(B2,$B$2:$B$101)+COUNTIF($B$2:B2,B2)-1,"")
For each name: in column E: =IFERROR(RANK(C2,$C$2:$C$101),"")
The next step was to use =IFERROR(VLOOKUP(A2,$D$2:$E$101,2,FALSE),"") in order to slot the names, at random, into prepared groups of 3-4 or 5.
I would like to have this be upgraded to a VBA formula
I have a list of names that need to have several formulas carried out on them, but that formula needs to also be based on the amount of names. The names are in column E of my document, and a list of numbers (from 1 to100) in column A. What I want to do is group the names into random groups of either 3-4 or 5. And then I would ideally need to be able to do the same thing again, but trying to make sure that the groups are not the same as they were last time.
What I did before trying to do this was VBA was the following:
For each name: in column C: =IF(E2="","",RANDBETWEEN(100,900))
For each name: in column D: =IFERROR(9+RANK.EQ(B2,$B$2:$B$101)+COUNTIF($B$2:B2,B2)-1,"")
For each name: in column E: =IFERROR(RANK(C2,$C$2:$C$101),"")
The next step was to use =IFERROR(VLOOKUP(A2,$D$2:$E$101,2,FALSE),"") in order to slot the names, at random, into prepared groups of 3-4 or 5.
I would like to have this be upgraded to a VBA formula