I am generating 202 sets of 4 numbers. The sum of each set of 4 needs to be 30, but I only want it to generate numbers such that the first number of each set of 4 sums to 500, the second number of each set sums to 500, the third number in each set sums to 300, and the fourth number sums to 200.
In Excel, I am using =INT(RAND()100) to generate a random integer 1-100, then applying =A130/SUM(A1:A4) to make sure the sum of each set of 4 sums to 30. I then tried =B7*20/SUM(B1,B5,B9) testing to see if I could get the first values of the first 3 sets to sum to a value (20) and that works as well. So, I found a way to generate numbers whose sums is 30, and a way to generate so every first number sums to a value, but not both. I cannot figure out a way to combine the conditions though so that both summations work.
Housefire is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.