Hi,
Suppose you'd like a sequence of length n composed of random integers between 0 and x. Furthermore, the sum of the sequence must be y. Repetition within the sequence is permitted. The output should come out starting at A1 and end at An.
Is there an efficient algorithm that can do this in VBA, within Excel?
To add another wrinkle to this, if possible, have it output values, as opposed to formulas. Specifically, when you use the RAND() formula in Excel, it changes values. Ideally, the output in column A would be static.
Thanks,
Pete
Suppose you'd like a sequence of length n composed of random integers between 0 and x. Furthermore, the sum of the sequence must be y. Repetition within the sequence is permitted. The output should come out starting at A1 and end at An.
Is there an efficient algorithm that can do this in VBA, within Excel?
To add another wrinkle to this, if possible, have it output values, as opposed to formulas. Specifically, when you use the RAND() formula in Excel, it changes values. Ideally, the output in column A would be static.
Thanks,
Pete