Trying to figure out the best way to utilize two packages

HZRMike

New Member
Joined
Jan 30, 2015
Messages
12
My business transfers donuts to different store and has to use two different sized packages.
Large Package fits 60 donuts and the small packages fits 36 donuts.
How do I write a formula to maximize the efficiency for packing donuts in the proper packaging.
For example, if I need to package 36 donuts, I'd use small package, if I have to send out 60, I'd use one small package, if i needed 68, I'd use two small packages, and if I needed 92 i'd use a small and a large.

In a perfect world any formula I create would be flexible so I can change the number of donuts that fit in each package so the spreadsheet doesn't become void, if anything changes.

Thanks for any help....
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Are you willing to post your workbook using a link on Box, Dropbox, 1Drive? Use the link icon at the top of the message box to do that.

Providing your workbook might help.

At least post the parts of your workbook that are relevant. Use Mr. Excel's excellent addin that enables you to post portions (ranges) of your workbook. See HERE.

Show where the formula is used and where the donuts per box data is stored now.
 
Upvote 0
Are you willing to post your workbook using a link on Box, Dropbox, 1Drive? Use the link icon at the top of the message box to do that.

Providing your workbook might help.

At least post the parts of your workbook that are relevant. Use Mr. Excel's excellent addin that enables you to post portions (ranges) of your workbook. See HERE.

Show where the formula is used and where the donuts per box data is stored now.
Sorry, I had trouble getting that Addin to load.
I do have a table that calculates the maximum capacity of various configurations of packages.

Small Package
36​
Large Package
60​
SmallLargeCapacityConfig
1​
0​
36​
1 Small
0​
1​
60​
1 Large
2​
0​
72​
2 Small
1​
1​
96​
1 Small, 1 Large
0​
2​
120​
2 Large

What I need is a formula for y(below) that takes the minimum number from this list that would still be larger than x, then I can use an index formula to pick the matching configuration.

# of DonutsPkg to Use
xy

Hope that makes sense thanks for your help.
 
Upvote 0
What is the largest quantity that you need to accommodate?
Good question, I'm not sure. That's why I want to keep the table with the various configurations flexible so I can add additional amounts if necessary.
Right now I'll just assume it's 120.
 
Upvote 0
Might you be willing to provide your workbook? You can post a link to it using Box, Dropbox, 1Drive. Use the link icon at the top of the message box. I'd like to set this up so it is consistent with your workbook.
 
Upvote 0
THIS WORKBOOK does what you asked for. It uses the data table that you provided to look up the right packaging. To change the packaging data update that table.

Also, I use worksheet "code names" instead of sheet/tab names so the function still works if someone changes the sheet/tab name.

See HERE for an explanation of code names.
 
Upvote 0
Maybe this helps:

MrExcel posts20.xlsx
CDEFGH
3CapacityPackageDoughnutsPackages
401S00
5361L11S
6602S351S
7721S,1L361S
8962L371L
9591L
10601L
11612S
12921S,1L
131202L
141212L
151222L
Sheet16
Cell Formulas
RangeFormula
H4:H15H4=XLOOKUP(G4,$C$4:$C$8+1,$D$4:$D$8,0,-1)
 
Upvote 1
Solution
I had a go at a flexible one.
MrExcelPlayground16.xlsx
AB
136
260
3
4136
5236
6336
73536
83636
93760
103860
115960
126060
136136, 36
146236, 36
157136, 36
167236, 36
177360, 36
189660, 36
199736, 36, 36
209836, 36, 36
2111960, 60
2212060, 60
2312160, 36, 36
Sheet19
Cell Formulas
RangeFormula
B4:B23B4=LET(check,A4,smallbox,$A$1,bigbox,$A$2,maxboxes,INT((check-1)/smallbox)+1,mat,SEQUENCE(maxboxes+1,maxboxes)-1,mata,MOD(mat,maxboxes)+1,matb,INT(mat/maxboxes),matc,mata>matb,matd,IF(matc,smallbox,bigbox),mate,TRANSPOSE(matd),diag,N(INT((SEQUENCE(maxboxes,maxboxes)-1)/maxboxes)+1>=MOD(SEQUENCE(maxboxes,maxboxes)-1,maxboxes)+1),matf,TRANSPOSE(MMULT(diag,mate)),matg,matf-check,mati,IF(matg<0,bigbox+1,matg),matj,mati=MIN(mati),x,matj*mata,y,matj*(matb+1),xx,MIN(IF(x=0,bigbox+1,x)),yy,MIN(IF(y=0,bigbox+1,y)),out,TEXTJOIN(", ",TRUE,INDEX(matd,yy,SEQUENCE(xx))),out)
 
Upvote 0

Forum statistics

Threads
1,215,463
Messages
6,124,962
Members
449,200
Latest member
indiansth

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