Check box type based on box and item dimensions

Excelquestion35

Board Regular
Joined
Nov 29, 2021
Messages
53
Office Version
  1. 2016
Platform
  1. Windows
Hi everyone,

Currently I am dealing with a puzzle regarding box types used for different items.
Based on the item dimensions, I have to decide which box fits best (use the smallest box possible).

I have the following workbook:

SKUShopware AuftragsnummerEA LengthEA WidthEA HeightEA Weight (kg)Weight checkEA LengthEA WidthEA HeightBox size
606146​
DE10162
58​
39​
11,5​
10,13OK
58​
39​
11,5​
Carton Type 1
605640​
DE10185
10​
7,6​
7,6​
4,98OK
10​
7,6​
7,6​
Carton Type 4
605840​
DE10345
58​
39​
11,5​
10,13OK
58​
39​
11,5​
Carton Type 1
606276​
DE10411
19​
11​
34​
9,66OK
34​
19​
11​
Carton Type 4
605596​
DE10503
9,9​
19,7​
14,4​
4,76OK
19,7​
14,4​
9,9​
Carton Type 4
605695​
DE10589
7,6​
7,6​
10​
5,05OK
10​
7,6​
7,6​
Carton Type 4

with the box sizes stored in a different sheet called Carton Maintenance:
DescriptionCarton CodeLength (cm)Width (cm)Height (cm)
Carton Type 1T1583931,5
Carton Type 2T2583915
Carton Type 3T338,52815
Carton Type 4T4382832

There is luckily no restriction on the way the item is fitted into the box.
Therefore, in the second set of EA dimensions, I sorted the items based on largest to smallest since this sorting comes closest to the respective box size dimensions.
However, what I have now is that the formula will always choose the largest or smallest box size but no box size in between while this possible.

The formula I used in the second row of the last column is:
Excel Formula:
=IFERROR(INDEX('Carton Maintenance'!$A$2:$A$5;MOD(SMALL(IF(L2<='Carton Maintenance'!$E$2:$E$5;IF(MAX(J2;K2)<='Carton Maintenance'!$C$2:$C$5;IF(MIN(J2;K2)<='Carton Maintenance'!$D$2:$D$5;'Carton Maintenance'!$C$2:$C$5*'Carton Maintenance'!$D$2:$D$5+(ROW('Carton Maintenance'!$A$2:$A$5)-ROW('Carton Maintenance'!$A$2)+1)/100)));1);1)*100);"No Match")

What would be a better way so that the formula fits the requirements of choosing indeed the optimized box size? For visual reasons I also attached pictures of the Excel sheet below.

Also, I am looking for a way to do the same trick but then to do an assessment of combining items of the same order (column B) into one box if that is possible. Orders can have more than 2 items (in this shared dataset every order only has one item) as well.
Is there a way to do this in an efficient fashion?

1659559686151.png

1659559714438.png


Your help is appreciated!
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Forum statistics

Threads
1,214,981
Messages
6,122,566
Members
449,089
Latest member
Motoracer88

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