Assign an option set group to student

I’m not sure how to explain this for the title so I’ll try here:

DB Details:
Each user object has a UsersGroup field. This has an option set.

Option Set Details:
I have 11 objects in the option set.
These names like Group 1, Group 2, Group 3, etc… till Group 11
Each have 3 attributes Display, Color (#hex value), and a number. Each user only needs to be assigned to a single Group.

What I’m trying to do is when a user signs up we automatically put them in a group. 1st user is in group 1, 2nd user is in group 2, etc till we reach Group 8. Then 9th user is added to Group 1, 10th is added to Group 2, etc… repeat till 8 again.

I know I can set a default, but I can’t figure out iterate through the option sets like above.

Any ideas how I can do this?

compare the number of the option set to the number of users (Do a search for users:count) and connect it to the option set that is the greatest factor of the new user’s number which would just b the number of current users + 1.

The users option set = all group:filtered (number = the factor):first item