Splitting excel data to multiple sheet evenly based on a certain condition

I have a master list of 16 rows with 2 columns of Name and Plevel (input picture). I want to distribute this list evenly based on Plevel to 3 teams. For example, in the master list, we have 3 P1, 3 P2, 5 P3, 3 P4, and 2 has no P. If I distribute the list evenly to 3 teams, each team should get:

Team 1: 1 P1, 1 P2, 2 P3, 1 P4, 1 no P
Team 2: 1 P1, 1 P2, 2 P3, 1 P4, 1 no P
Team 3: 1 P1, 1 P2, 2 P3, 1 P4

Do you know how I can achieve that? Thank you so much for all your help!

Input:

Output Team 1:
image

Output Team 2:
image

Output Team 3:
image

@ndtran85
Please find the solution fyr and voice out if any queries.
p_allocate.xaml (24.0 KB)
project.json (1.7 KB)

Hi @healsko_ho , it works!! thank you so much!!!

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