Forum Discussion
Student Schedules
quaranteach If I read correctly, if students have a free period (some might 1, some might have more than 1, and some might have none) that period will not show up on their schedule, so you want to ensure all periods are accounted for whether free or otherwise. Therefore, I ignored the "Blocks" in your table and assumed that all students should have all blocks (A-H).
In the original table, there were 3 unique students. I created a separate table to manage the # blocks each student should have (8 blocks if using A-H). Using a combination of both the unique student list multiplied by the number of blocks (A:H) tells us we should have a total of 24 records for the base schedule.
Note this formula requires Excel 365 to work:
The formula uses the number of blocks to determine how many times the student ID/name combination should repeat, and then uses the number of students to determine how many times blocks A-H should repeat. Lastly, it combines the result of those two formulas. The animated picture shows how a single formula (entered once & only in cell J2) will update based on either changes in the number of blocks or number of students.
=HSTACK(CHOOSEROWS(UNIQUE(tbl_StudentList[[ID]:[Student Name]]),ROUNDUP(SEQUENCE(COUNTA(tbl_Blocks[Block Possibilities])*COUNTA(UNIQUE(tbl_StudentList[ID])),1,1,1)/COUNTA(tbl_Blocks[Block Possibilities]),0)),INDEX(tbl_Blocks[Block Possibilities],MOD(SEQUENCE(COUNTA(tbl_Blocks[Block Possibilities])*COUNTA(UNIQUE(tbl_StudentList[ID])),1,1,1)-1,COUNTA(tbl_Blocks[Block Possibilities]))+1))
This is likely an over-simplification of what you need with a formula syntax which is very difficult to understand. 🙂
But I hope this helps achieve what you're seeking.
Dexter