Forum Discussion
Excel
Mar 08, 2021Iron Contributor
Determining random numbers that add up to a predetermined sum
Hello Everyone, My goal is to create a random set of numbers that add up to a particular total. In the image below, you'll see a column of 10 numbers and its total in A12. What function would I nee...
PeterBartholomew1
Mar 08, 2021Silver Contributor
A solution using Excel 365.
= LET(
rand,RANDARRAY(N),
upper, 1+INT(target*rand/SUM(rand)),
remainder, MOD(rand,1),
k, SUM(upper) - target,
limit, SMALL(remainder,k),
upper - (remainder<=limit) )
where target =310 and N = 10 for the case described.
Even then, I am not absolutely sure that every possibility has an equal probability of being selected.
Excel
Mar 13, 2021Iron Contributor
It worked!!! Thank you so much sir😊😊