'Creating a random draw with rules
I am trying to create a solution for automated draws (originally as an Excel file) which can help me distribute 1944 coins into 648 bundles of 3 coins each.
The coins are coming from 10 buckets. Bucket 1 contains Gold coins. Buckets 2, 3 and 4 contain Silver coins. Buckets 5, 6, 7, 8, 9 and 10 contain Bronze coins.
Here's a sheet with sample data: https://docs.google.com/spreadsheets/d/13ORB2QrvPVHepTVRWhmvQg7asyl_aYQhs6_4Ae2IyQg/edit?usp=sharing (The Bundles sheet currently contains a solution that works but is not random. This solution is coming from another question asked on superuser: https://superuser.com/questions/1711583/excel-logic-for-complex-draw-from-different-buckets-without-repeating-bucket)
There are 2 distribution rules to be followed:
- Each Bundle in the Bundles sheet must contain 3 coins from different buckets
- Each Bundle in the Bundles sheet must contain either:
a) 1 Gold and 2 Bronze coins
b) 1 Silver and 2 Bronze coins
c) 3 Bronze coins
Any idea what formulas and logic I can use to automate the distribution while satisfying the rules?
Bonus points if the solution allows for truly random distribution (after satisfying the rules).
Super bonus points if the solution can work with the amount of coins of in each bucket as variables, the number of buckets as variables, and the number of bundles as variables. (Of course, they will all need to work out as multipliers, by design.)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
