Allocating students to courses using primary and backup selections with capacity limits

Looking for a formula to assign 160 students based on two top and two reserve course picks with fixed limits. Example:

=IF(SUMPRODUCT(--($B$1:$B1=GETCRS(D2:G2,"first")))<maxCap, GETCRS(D2:G2,"first"), GETCRS(D2:G2,"backup"))

hey, maybe check if your count of first choice is below cap with sumproduct, then simply shift to backup if not. nesting if’s could be more flexible than a single formula. try to do this dynamically so enlitment caps are always met

Based on my experience, using nested conditions with helper calculations can be more manageable than a single complex formula. I prefer separating the counting of course enrollments into an auxiliary section with COUNTIF or SUMPRODUCT functions. This method makes it easier to validate that capacity limits are adhered to. By pre-calculating the number of students in each course, you can then reference those values in your main formula. This approach reduces potential errors and simplifies maintenance in the long run, which is particularly valuable in cases with multiple selection rounds.

Hey everyone,

I found myself thinking about making this process more modular. Instead of having one gigantic formula doing all the work, what if we break it down a bit? For instance, you could use a helper column to tally current enrollments and then decide if a student’s first choice still has capacity. If you’re on Office 365, the new dynamic array functions might let you recalc these live, which sounds pretty neat.

Have you ever tried using functions like LET or even LAMBDA to encapsulate some of these steps? I know they can really clean up the mess when working with multiple dependent conditions. I’m curious to hear if anyone else experimented with a strategy where you first assign everyone a tentative spot and then adjust if a cap is exceeded. I wonder if breaking it down that way might offer a clearer picture of where the process might fail or need tweaks.

What do you all think? Would love to know if someone has given a version of this a go or has some extra insights on balancing formula complexity and readability. :blush:

hey, i tink separating enrollment count from assignment keeps things clear. i tried helper colums and a post-check step to reassign overflow. sometimes a two-stage process is easier to debug than one massive formula. anyone else test this approach?