Finding optimal combination of two sizes

Jasonx

New Member
Joined
Sep 22, 2009
Messages
6
Hello,

I am hoping someone can help me out with this formula. I am looking to find a formula that will calculate the least amount of waste when two sized packages are needed to fill an order. The price per unit is the same for both packages, so that is not an issue.

Two sizes of the same product are used to fill an order. Example: Package (A) "630 units" and Package(B) "135 units". An order of 17,000 units is needed. How would you find the best combinations of A and B to come closest to the 17,000 unit order? Ideally the combination of the two would be within + or - 5% of the target (although this is probably unattainable in every situation).

Thanks
 
Thanks for the feebackk.
Btw,
Rich (BB code):
    If targetNum < num1 Or targetNum < num2 Then
        optCombo = "#>TRG"
        Exit Function
    End If

should be
Rich (BB code):
    If targetNum < num1 And targetNum < num2 Then
        optCombo = "#>TRG"
        Exit Function
    End If
 
Upvote 0

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

Forum statistics

Threads
1,224,551
Messages
6,179,476
Members
452,915
Latest member
hannnahheileen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top