Lowest Cost Lookup

rickyken

New Member
Joined
Apr 26, 2018
Messages
2
Hi, I have a list of postcodes in column A, carriers in column B, and their rates in column C as below. I'm looking for a for a formula to replace "XXX" under the lowest cost section to look up the postcode in the list in column A and return the applicable carrier from column B based on which carriers rate is lowest in column C. I've tried mixing the INDEX, MATCH and MIN functions but can't get it to work correctly. Does anyone know if and how this can be achieved? Once I've got "XXX" sorted, I'll be able to use the same method for "YYY" to show the lowest rate. Cheers for your help!!
PostcodeCarrierRateLowest Cost
cw10carrier 1180CarrierRate
cw10carrier 2187cw10XXXYYY
cw10carrier 3188cw8XXXYYY
cw8carrier 2180st4XXXYYY
cw8carrier 1181
cw8carrier 3190
st4carrier 3270
st4carrier 1250
st4carrier 2255

<colgroup><col><col><col span="4"><col><col></colgroup><tbody>
</tbody>

<tbody>
</tbody>
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Here's one way.
The INDEX formula in G3 is an array formula and must be entered with CTRL-SHIFT-ENETR.
Drag formulas down as needed.
Excel Workbook
ABCDEFGH
1PostcodeCarrierRateLowest Cost
2cw10carrier 1180CarrierRate
3cw10carrier 2187cw10carrier 1180
4cw10carrier 3188cw8carrier 2180
5cw8carrier 2180st4carrier 1250
6cw8carrier 1181
7cw8carrier 3190
8st4carrier 3270
9st4carrier 1250
10st4carrier 2255
Sheet
 
Upvote 0
If you want a smaller formula, sort the data first and the first match in each postcode is the cheapest

Postcodes in column A, Carriers in Column B, Rate in Column C
PostCode to lookup in F2

=INDEX(B:B,MATCH(F2,A:A,0)) Cheapest Carrier
=INDEX(C:C,MATCH(F2,A:A,0)) Rate

SORT
First Level by Postcode
Second level by cost (from lowest to highest)
Looks like this
PostcodeCarrierRate
cw10carrier 1180
cw10carrier 2187
cw10carrier 3188
cw8carrier 2180
cw8carrier 1181
cw8carrier 3190
st4carrier 1250
st4carrier 2255
st4carrier 3270

<tbody>
</tbody>

RESULT
CarrierRate
cw10carrier 1180
cw8carrier 2180
st4carrier 1250

<tbody>
</tbody>
 
Last edited:
Upvote 0
Row\Col
A​
B​
C​
D​
E​
F​
G​
H​
I​
1​
PostcodeCarrierRateLowest Cost
2​
cw10carrier 1
180
RateCarrier
3​
cw10carrier 2
187
cw10
180
carrier 1carrier 3
4​
cw10carrier 3
180
cw8
180
carrier 2
5​
cw8carrier 2
180
st4
250
carrier 1
6​
cw8carrier 1
181
7​
cw8carrier 3
190
8​
st4carrier 3
270
9​
st4carrier 1
250
10​
st4carrier 2
255

In H3 control+shift+enter, not just enter, and copy down:

=IFERROR(INDEX($B$2:$B$10,SMALL(IF($A$2:$A$10=$F3,IF($C$2:$C$10=$G3,ROW($B$2:$B$10)-ROW($B$2)+1)),COLUMNS($H3:H3))),"")
 
Upvote 0

Forum statistics

Threads
1,214,965
Messages
6,122,495
Members
449,088
Latest member
Melvetica

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