Formula to determine variable of gross profit %

Attached is a spreadsheet with two accounts. Each account has the same retail and invoice. One school has a small enrollment and the other has a larger enrollments. There is a handling fee of $2 per enrollment. There are only two variables that can be changed: brochure cost & incentives. Also, the larger the enrollment, the larger the brochure cost. Brochure Cost can be reduced only a certain amount. The cheapest it can be reduced is 110% of # of students. So for John Spicer, the Brochure Cost could be reduced to 683.10 (621 students x 1.10 = $683.10)

The goal is to reach a 36% gross profit margin...which is (profit / invoice). Profit is Invoice - Total Expenses

There should be a way to figure a lump sum of the amount you have to spend on brochures and incentives. For example of Spicer, you can spend $843.10 on brochures and incentives....which is $683.10 on brochures and $160.00 on incentives.

I can figure adjust brochure cost & incentive cost to reach the 36% but I know there is a formula to make it easier.