I'm trying to build a system where I have a list of Items with weights associated with them. I want to randomly pull items from this pool, using their weights to determine chance of selection.
In the example spreadsheet, I have 10 fruits. I want to pull 3 fruits from the pool. The same fruit cannot be pulled more than once. These 3 fruits would be a fruit-selection.
I want to do this many times, across multiple rows, each providing a new random fruit-selection.
- I've come across a couple of issues:
Occasionally I've got this error:
[Error Function INDEX parameter 2 value is 8. Valid values are between 0 and 7 inclusive.]
Sometimes the formula for pulling an item results in an empty cell.
- I'm probably not also doing this the most efficient way. I may need up to 300 rows of these 'fruit-selections'
- Finally, I would like to determine the number of fruits being drawn to make up each fruit-selection. I've not hooked this up yet as I was trying to get the above working.
I'm hoping there's an efficient way of doing this. Maybe using sequence?
Appreciate any help / advice on this one.