Split a list randomly into 2 equally sized lists

Hello everyone,
I would like to create a random team generator. How do I divide a list of names randomly into 2 teams without repeating the names or having 3 names in one team and 1 name in the other?

  1. Shuffle your list of names
  2. Get the length of the list of names
  3. Divide by 2 and round the result (e.g. if list is length 11, 11/2 = 5.5, rounded = 6)
  4. Add the first half of the names to a new list
  5. Add the remaining names to a second new list

Something like this:

1 Like

Thank you, helped a lot.
Can I display the teams separately in 2 list views?

Yes you can

What is the best way to do this? Each name should be a single element. The Names in the Nameslist are also elements

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.