I have a formula that runs a relatively simple calculation to determine the chance of a small list of items being picked out of a larger list. These lists are based on a video game, and are comprised of the names of monsters that the player can be told to go kill for experience points.
The smaller list are monsters that the spreadsheet user is willing to kill, while the larger list is every monster they could be assigned to kill. The chance of each monster being assigned is based on a value and an "Action", and the calculation uses this value and action to ascertain and sum the chances of the small list. This sum must be greater than or equal to 48.4%.
Then the monster with the lowest Experience Points per hour is removed from the small list, and the calculation is run again. This monster is chosen from a third list with experience point information for each task from the small list.
I need a custom function that loops through this process until the calculation returns a number lower than 48.4%, and then return the previous result that was greater than or equal to 48.4%.