The source of the numbers is column A. Column B is the amount of each of these numbers.
The top x % (I want this as the parameter) sets the range from which I want random numbers, it is the top x % of the sum of the amount. In this case 191,166 and 164 is the top 25% of the total sum of amount values.
Based on this, I want 50, 15 and 6 randomly generated with 37%, 32%, 31% probability. By changing the top % value to 50%, I want 50,15,6,17,65,75 randomly generated with 20%, 17%, 17%, 16%, 16%, 14% probability, and so on.
Without using macros, if possible.
excel 1.jpg
Bookmarks