jeudi 26 janvier 2017

Randomly placing ID's in specific groups with maximum capacities based on preference

I've been struggling with this process for weeks. I have a process, but it is clunky and cumbersome. Currently, I have a list of 863 unique ID's that need to be placed into 24 different categories that have max capacities. For example, in the table below, "C1" can only hold 33 unique ID's. To make it even more difficult, Each unique ID has a preference of "A", "B", "C", or "D" on a another sheet where a 1, 2, 3, or 4 has been assigned to each letter based on preference (1 being the most desired; 4 being the least).

A unique ID will have a number or numbers assigned to it. So if unique ID has a "6" then it will have to take a space on 6, depending on it's preference of letter. It could have multiple numbers. For example, another unique ID could have a 6, 4, and 3... in which case, it would take up three spots in the table below. If the ID with 6, 4, and 3 had a preference of "D", then it would take a capacity spot under D for rows 3, 4, and 6.

The idea is to randomly place ID's based on their first choice until space is filled, then moving to their second choice, and then third, and so on until all of the space is filled.

Currently, I am assigning a random number using RANDBETWEEN and then sorting that column to "Randomize" the order of the list and then I am literally filtering first choice from letter and highlight rows to get a count for each number. It takes about 30-40 minutes to do manually.

This is something that will need to be done every 6 months with more and more groups so I am hoping to find something that will help minimize the manually filtering and highlighting.

    A   B   C   D
0   25  18  20  25
1   33  25  33  20
2   33  25  30  28
3   45  25  30  28
4   33  35  30  30
5   38  35  33  30
6   51  35  35  35

Thank you for all advice in advance!




Aucun commentaire:

Enregistrer un commentaire