+ Reply to Thread
Results 1 to 3 of 3

Lookup against 2 values, one set, one within a range.

  1. #1
    Registered User
    Join Date
    04-02-2012
    Location
    Amersham, England
    MS-Off Ver
    Excel 2007/10
    Posts
    7

    Lookup against 2 values, one set, one within a range.

    Hi Guys,

    I have a sheet with a list of countries and postcodes we use. Certain post code ranges need to be highlighted as they have surcharges against them.

    E.g.
    COUNTRY START POSTCODE END POSTCODE SURCHARGE
    FRANCE 50000 51000 £0
    FRANCE 51000 52500 £15
    FRANCE 52500 53000 £20
    FRANCE 53000 55000 £0

    I need to be able to lookup against two values, the country and also a number that occurs within a range, so in this case, I might chose France as the country, and enter the post code of 52522 and see that it should return a value of £20.

    Alternatively, if it is very hard to do this, is there a way I can take the two range limits and convert them into a list across a row of cells of all values in that range, or even better, into a list. E.g.

    COUNTRY START POST CODE END POST CODE
    FRANCE 50000 51000

    Becomes

    FRANCE 50000
    FRANCE 50001
    FRANCE 50002
    FRANCE 50003
    FRANCE 50004

    And so on. I appreciate it may need to go through some intermediary steps to format all the data.

    Many thanks in advance,

    Bob

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Lookup against 2 values, one set, one within a range.

    Like this..
    Attached Files Attached Files
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,937

    Re: Lookup against 2 values, one set, one within a range.

    I would use a SUMIFS:

    =SUMIFS(Sheet1!D:D,Sheet1!A:A,A2,Sheet1!B:B,"<="&B2,Sheet1!C:C,">="&B2)


    Where your table is in A:D of Sheet1, and the country name is in A2 and the postcode of interest is in B2
    Bernie Deitrick
    Excel MVP 2000-2010

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Match or lookup in a range of values
    By The Solar King in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-31-2014, 02:40 PM
  2. Replies: 4
    Last Post: 05-22-2013, 04:15 AM
  3. [SOLVED] Lookup help - can lookup address values that fall within a range?
    By Ruthie83 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-16-2013, 10:25 PM
  4. Using a range of values in a lookup function
    By tolhouse in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-02-2011, 04:01 AM
  5. [SOLVED] How do I use LOOKUP to return a range of values, then SUM values?
    By irvine79 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-04-2006, 08:35 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1