How to get my Freight rates from two tables?

CopperKnife

New Member
Joined
May 26, 2015
Messages
14
Hello all,

I have two tables like the following.

Table-1

Weight
Mode
FreightKey
10Road??????
8Rail??????
45Sea???????
5Air??????
23Sea??????

<tbody>
</tbody>

Table-2

Weight
ModeFreightRateFreightKey
20Rail6%RA20
30Road4%RO40
40Air20%AI40
50Sea8%SE60
60Road12%RO60

<tbody>
</tbody>

I need to get the FreightKey from the second table to the first table.

I tried Index/Match with less than, greater than choices also Vlookup with approximate match. But I could not get the correct result.

I need to get the FreightKey according to their Weight and Mode of transport.

Please check the following link to get the sample work book.

https://drive.google.com/file/d/0B8-z_iZazKR1MFB1cDUxdkc4YkU/view?usp=sharing

Thanks
CopperKnife
 
Last edited:

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.
You need to Sort Table2 Descending for Columns I (Weight) & J (Mode).
Then use the array formula (enter with CTRL+SHIFT+ENTER.)
=INDEX($L$2:$L$41,MATCH(A2&B2,$I$2:$I$41&$J$2:$J$41,1))

Dang, it looked right and I was waiting on Excel to become unbusy. Went back to check after posting, and it wasn't.:mad:
 
Last edited:
Upvote 0
Hi,
Its already sorted. If you use "1", in the MATCH function as the last argument it gives you exact match, which in this case will throw up #N/A errors, SpilerBD !

Any help from any body??!
CopperKnife
 
Upvote 0
What is your criteria? For a weight of 5, does that round up to 10, or are you looking for it to select a return value that is greater than or equal to 5? i.e. 20, since 20 is the smallest weight in your 2nd table.
 
Upvote 0
Try this:

Excel 2010
ABCDEFGHI
1WeightModeFreightKeyWeight ModeFreightFreightKey
25SeaSE2020Air0.08AI20
310RoadRO2020Sea0.03SE20
413RailRA2020Road0.06RO20
534RailRA6020Rail0.04RA20
66RoadRO2030Air0.1AI40
710AirAI2030Sea0.05SE40
869AirAI12030Road0.08RO40
919SeaSE2030Rail0.06RA40

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Array Formulas
CellFormula
C2{=INDEX(freightkey,MATCH(1,IF(Mode=B2,IF(weight>=A2,1)),0))}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>

Workbook Defined Names
NameRefers To
freightkey=Sheet1!$I$2:$I$41
Mode=Sheet1!$G$2:$G$41
weight=Sheet1!$F$2:$F$41

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0
Yeah, this is what I want, mick0005. You are great.

Thanks.

Took me awhile... was overthinking if there was a way to have two match types... 1 being exact and 1 being greater than or less than. Figured out instead it just needed to be built into the logic of the match itself.

I actually just saved this one into my personal workbook for my own future reference :)
 
Upvote 0

Forum statistics

Threads
1,214,520
Messages
6,120,008
Members
448,935
Latest member
ijat

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