• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to generate Random Numbers with fixed sum

sanjeev kumar

New Member
Total Count = 30

random numbers should be between 0 to 2

Total should be between 25 to 30

plz find the attachment.
 

Attachments

  • Random.xlsx
    9.8 KB · Views: 27
Hi Sanjeev ,

It is not really necessary to generate random numbers for the purpose that you have described.

Since you want a total between 25 and 30 , if we can settle on 28 , this works out to 10 values of 1 and 9 values of 2 ; thus if we have 11 values of 0 , this will constitute the list of numbers.

Just put down ten 1s , nine 2s and 11 zeroes , and then sort the list using a helper column of random numbers ; you will end up having a scrambled list of zeroes , ones and twos.

Narayan
 
Back
Top