+ Reply to Thread
Results 1 to 8 of 8

3D look-ups? Indexes?

  1. #1
    Forum Contributor
    Join Date
    12-02-2008
    Location
    Brisbane
    MS-Off Ver
    2016
    Posts
    807

    3D look-ups? Indexes?

    How can I sensibly do a 3-d look up? I need to extract shipping rate between two ports and rate is dependent on weight (different weight breaks have different rates as per the tables below). (I can't upload the workbook due to server restrictuions.)

    Weight From To Rate Total
    8.20 kgs HBT NYC 1.49 12.20
    Formula under $1.49 is:
    =IF(AND($C$3>B5,$C$3<=C5),INDEX($D$7:$L$15,MATCH(E3,$C$7:$C$15,0),MATCH(F3,$D$6:$L$6,0)),IF(AND(C3>$B$17,C3<=C$17),INDEX($D$19:$L$27,MATCH(E3,$C$19:$C$27,0),MATCH($F$3,$D$18:$L$18,0)),"ETC"))

    With this formula you simply run our of nesting levels.


    Please Login or Register  to view this content.

    etc., etc., etc.
    Last edited by BRISBANEBOB; 12-04-2012 at 11:35 PM.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: 3D look-ups? Indexes?

    Please attach a sample workbook with expected output for getting quick solution.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Contributor
    Join Date
    12-02-2008
    Location
    Brisbane
    MS-Off Ver
    2016
    Posts
    807

    Re: 3D look-ups? Indexes?

    If only I could. The server/mail marshal won't allow uploads out.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: 3D look-ups? Indexes?

    As long as the STARTING value for each table is in a cell by itself (not text), then this is pretty straightforward. In F5:

    =INDEX(OFFSET(INDEX($C$7:$C$10000, MATCH(C5, $C$7:$C$10000, 1)), 2, 1, 9, 9), MATCH(D5, $C$9:$C$17, 0), MATCH(E5, $D$8:$L$8, 0))
    Attached Files Attached Files
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  5. #5
    Forum Contributor
    Join Date
    12-02-2008
    Location
    Brisbane
    MS-Off Ver
    2016
    Posts
    807

    Re: 3D look-ups? Indexes?

    Hi Jb

    Thank you very much, your assistance is much appreciated. Your reputation has been enhanced!

  6. #6
    Forum Contributor
    Join Date
    12-02-2008
    Location
    Brisbane
    MS-Off Ver
    2016
    Posts
    807

    Re: 3D look-ups? Indexes?

    Hi JB

    I have worked my way through the forumla and I am not completely sure how the OFFSET works. The rest is straight forward but the OFFSET appears to be the key.

    Regards

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: 3D look-ups? Indexes?

    OFFSET() take a starting point, then moves x-rows and x-columns to set a new starting point, then is expanded to include y-rows and y-columns to become a reference "range".

    =OFFSET(startingrange, moverow(s), movecolumns(x), [height], [width])

    It appears you understand INDEX/MATCH/MATCH, and this is all we're really doing, except we create the INDEX range using the OFFSET formula above.

    We use MATCH to set the first cell as the first cell in column C that is LESS than the search weight, this keys us to the correct table.
    Then the OFFSET function moves down 2 rows, moves over 1 column, then expands to a 9x9 set of cells from that point.


    Use the EVALUATE FORMULA function to watch the formula unfold one calc at a time, that should help make it clear.

  8. #8
    Forum Contributor
    Join Date
    12-02-2008
    Location
    Brisbane
    MS-Off Ver
    2016
    Posts
    807

    Re: 3D look-ups? Indexes?

    Thanks JB. Enjoy your coffee!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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