+ Reply to Thread
Results 1 to 3 of 3

Looking up a value based on several index columns?

  1. #1
    Registered User
    Join Date
    07-02-2012
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Looking up a value based on several index columns?

    Is there some kind of vlooup/match/index function that allows you to lookup values using two columns of data?

    For example, I want to use both AK and 4 to get the value 1200.

    AK 1 100
    AK 2 150
    AK 3 800
    AK 4 1200
    CA 1 50
    CA 2 300
    CA 3 750
    CA 4 900

    I know I could do this by adding another column with something like column1.column2 as an index, but I am looking for something cleaner since it's going in a Macro.

    Maybe I can find all the AK's, select that portion of the table, move my selection over, then vlookup the 4 just in that portion of my table? Seems so complicated...

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,736

    Re: Looking up a value based on several index columns?

    If you can guarantee that the combination only occurs once, then you can use this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    You could put the AK and the 4 into two cells, and use the cell references within the formula.

    Obviously, you should change the range references in the formula to suit your data.

    Hope this helps.

    Pete

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Looking up a value based on several index columns?

    maybe the simplest way would be to add a helper column...=A1&B1, copied down, and then base a regular vlookup on that
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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