with D2 the active cell, you can apply the following rule (and apply to D2:BR2)
the above will find items left to right, in that order, until such time as the stock requirement is filled, or there are no other options to complete it.
edit: if you end up with scenarios where you have stock of say 150, and available values of 144, 72 and 78 -- the above will format 144, rather than 72 & 78
so, if it transpires that you want the 'optimal' combination (i.e. combination closest to total) then things get a whole lot more complicated - to point of not really being feasible (in XL)
Bookmarks