Vlookup - tough one for sure!

excelbetter

Board Regular
Joined
Oct 13, 2010
Messages
190
Can anyone help?

I am looking to do a "lookup" whereby I find the total cost of shipping x# of boxes via UPS. Let me see if I can complicate this a bit further.

When we ship a bunch of stuff to our customers, the order will go in several boxes. UPS charge different rates per box shipped. So, 1 box of 5 lbs is cheaper than an order of 5 lbs total broken into 2 boxes of 2 lbs and 1 box of 1 lbs. (i.e the rates and zones shown in the image below)

Therefore, I'm trying to figure out how I can have a "total order weight" and a "max weight per box" and create a formula that does 3 things:

1) Figure out how many boxes there will be on the order (i.e. total order weight / max weight per box)

2) Figure out the exact weight of each box if the total order weight was 5 lbs and the max weight per box (i.e. a fixed variable) is 2 lbs, I can logically see there will be 2 boxes of 2 lbs each and 1 box of 1 lbs.

3) Use some lookup feature to find the combined total rate of the 3 boxes above (i.e. 2 @ 2 lbs each and 1 @ 1lb).

Any thoughts on how to do this? Thanks.

NOTE: The Total Order weight in the image should read 5 lbs, not 2 lbs as shown. The max weight per box is 2 lbs.

Screen%20shot%202011-08-05%20at%205.54.26%20PM.png


- Show quoted text -
 
Last edited:
Tauren,

When I tested your formula changing the max box weight to 4 lbs instead of 2, and then change the zones, I am not getting the correct results. I can't figure out what's wrong, but I don't ge the right results.


Un-NAME-ed approach, with the same layout will be:
Excel Workbook
ABCDEFGH
1Zones
2WEIGHTSZ1Z2Z3Z4ZONEZ3
3139141040Total Order Weight5
42135178Max Box weight2
532291910No boxes3
6448154214
758303234Total Cost:44
Sheet1
 
Upvote 0

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
I should have tested it more. Sorry for the erroneous formula.
Formula in H7 for 2007+
Formula in H8 for 2003-

<TABLE style="BORDER-BOTTOM-STYLE: groove; BORDER-BOTTOM-COLOR: #00ff00; BORDER-RIGHT-STYLE: groove; BACKGROUND-COLOR: #fffcf9; BORDER-TOP-COLOR: #00ff00; FONT-FAMILY: Arial; BORDER-TOP-STYLE: groove; COLOR: #000000; BORDER-RIGHT-COLOR: #00ff00; FONT-SIZE: 10pt; BORDER-LEFT-STYLE: groove; BORDER-LEFT-COLOR: #00ff00"><TBODY><TR><TD>Spreadsheet Formulas</TD></TR><TR><TD><TABLE style="FONT-FAMILY: Arial; FONT-SIZE: 9pt" border=1 cellSpacing=0 cellPadding=2><TBODY><TR style="BACKGROUND-COLOR: #cacaca; FONT-SIZE: 10pt"><TD>Cell</TD><TD>Formula</TD></TR><TR><TD>H7</TD><TD>=IFERROR((ROUNDDOWN(H3/H4,0)*INDEX(A2:E7,MATCH(H4,A2:A7,0),MATCH(H2,A2:E2,0))+(H5-ROUNDDOWN(H3/H4,0))*INDEX(A2:E7,MATCH((H5-ROUNDDOWN(H3/H4,0)),A2:A7,0),MATCH(H2,A2:E2,0))),H5*INDEX(A2:E7,MATCH(H4,A2:A7,0),MATCH(H2,A2:E2,0)))</TD></TR><TR><TD>H8</TD><TD>=IF(ISERROR((ROUNDDOWN(H3/H4,0)*INDEX(A2:E7,MATCH(H4,A2:A7,0),MATCH(H2,A2:E2,0))+(H5-ROUNDDOWN(H3/H4,0))*INDEX(A2:E7,MATCH((H5-ROUNDDOWN(H3/H4,0)),A2:A7,0),MATCH(H2,A2:E2,0)))),H5*INDEX(A2:E7,MATCH(H4,A2:A7,0),MATCH(H2,A2:E2,0)),(ROUNDDOWN(H3/H4,0)*INDEX(A2:E7,MATCH(H4,A2:A7,0),MATCH(H2,A2:E2,0))+(H5-ROUNDDOWN(H3/H4,0))*INDEX(A2:E7,MATCH((H5-ROUNDDOWN(H3/H4,0)),A2:A7,0),MATCH(H2,A2:E2,0))))</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,238
Messages
6,170,939
Members
452,368
Latest member
jayp2104

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