Forum Discussion
Lucamuraz
Jan 18, 2023Copper Contributor
How to take in account frequancy with random selection
Hi I want select element from a list randomly but respecting some frequency value. So I have 5 element: A=(45, 12, 6, 2, 1) and the related frequency; B=(0.02, 0.08, 0.30, 0.35, 0.35) respectively. ...
Riny_van_Eekelen
Jan 18, 2023Platinum Contributor
Lucamuraz I count to 880 rows when using your sequence of 16, 64, 240, 280, 280. Assumed you wanted the first 280 to be 200. Just guessing though.
Then I used Power Query to quickly generate a list of 800 numbers with that frequency. Loaded it back to Excel and added a manual column with random numbers that I then sorted in ascending order. Just as an example, though.
The first column then gives you a list of 800 randomized numbers with the correct frequency for each of the 5 numbers (45, 12, 6, 2, 1).
Is that what you had in mind?