Shipping look up by country and also between a range of weight to find a value

VickyPalmer

New Member
Joined
Mar 12, 2021
Messages
3
Office Version
  1. 2019
Platform
  1. Windows
Hello, I'm hoping someone could help me with the following problem please. I have a excel sheet that has the following columns: Country, Weight from, Weight to, Cost. eg United States, 1 (Kg), 1.5 (Kg), $5.
The spreadsheet has multiple countries, different weight from and to and then the cost. I need to be able to look up a specific country, then find the right weight category and retrieve the value associated with that.

Eg look up United States for 1.11Kg it will need to first identify united states then identify that 1.11Kg is between the values 1Kg--1.5Kg and retrieve the value next to that.

I've tried multiple INDEX match formula's vlookup true etc but cannot identify a formula that would work, any help will be much appreciated.

Thank you
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
does this work for you
NOTE the sort order of the table , is largest to smallest weight & index/match uses the -1 for match type Greater than

so in my example 1.7 will got to the value for 2
and not the lower value of 1.5
I have also added in a MAX weight - this is just a number you would never reach - with the same cost , so in my example anything over 2 up to 10000 will be the same price as 2
maybe a better way to do that
Book10
ABCDEFGH
1CountryWeightReturn Pricecountryweightprice
2USA430.5UK100003000.5
3UK23000.5
4UK1.52000.5
5UK11000.5
6usa1000030.5
7usa230.5
8usa1.520.5
9usa110.5
Sheet1
Cell Formulas
RangeFormula
C2C2=INDEX(H2:H9,MATCH(B2,IF(F2:F9=A2,G2:G9),-1))
 
Upvote 0
Solution
Hi, thank you for you reply so promptly, unfortunately the formula is returning a #N/A. If use your H for the price, B for the weight I want to look up, F for the country and A for the country I want to match to and G for the weight range to be looked up but can't get it to work? not sure what I may be doing wrong?
 
Upvote 0
can you post a sample using XL2BB or put the spreadsheet on a share like onedrive or dropbox preferably, rather than a random sharing site

breaking down the formula

=INDEX(H2:H9,MATCH(B2,IF(F2:F9=A2,G2:G9),-1))

=INDEX(H2:H9 - this column has the PRICE to find and return
MATCH(B2 - This is the Weight you want to lookup
IF(F2:F9 - This is the column with the countries listed - NOTE you need to have all rows filled , even if same country in the table
(F2:F9=A2 - A2 is the country you want to find
G2:G9 - is the Table of weights, SORTED largest at top for each country
-1 - find the nearest value which is greater than the lookup value

you are using 2019 - so should be fine
If use your H for the price, B for the weight I want to look up, F for the country and A for the country I want to match to and G for the weight range to be looked up but can't get it to work? not sure what I may be doing wrong?

That seems correct -

can you post a sample using XL2BB or put the spreadsheet on a share like onedrive or dropbox preferably, rather than a random sharing site

you should be able to copy my example into a spreadsheet and test
Between the A and 1 - you see the copy icon

if you are copying down a sheet , you would need to fix the ranges using a $
 
Last edited:
Upvote 0
Hi again I just realised I did a rookie mistake and didnt finish the formula with control, shift return. It now works perfectly - thank you so much for your help, I really appreciate it.
 
Upvote 0
Ok, sorry , i thought 2019 did arrays automatically like 365 , but must be wrong
 
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,575
Members
449,039
Latest member
Arbind kumar

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