+ Reply to Thread
Results 1 to 7 of 7

Vlookup multiple columns

  1. #1
    Registered User
    Join Date
    06-15-2015
    Location
    Seattle
    MS-Off Ver
    2013
    Posts
    62

    Vlookup multiple columns

    I have columns by SKU product and supplier but the problem with vlookup is that it returns the first finding. So I have multiple product lines that may be the same but with different skus and suppliers.

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Vlookup multiple columns

    Maybe try looking into advanced filter as substitution for vlookup

    http://www.contextures.com/xladvfilter02.html

  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,944

    Re: Vlookup multiple columns

    Another option would be to used the INDEX/SMALL/IF array, but to show how that works, you would need to upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.
    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

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Vlookup multiple columns

    Maybe this...

    Data Range
    A
    B
    C
    D
    E
    F
    G
    1
    Product
    SKU
    Supplier
    Product
    SKU
    Supplier
    2
    A
    11
    1
    C
    44
    2
    3
    A
    22
    1
    55
    3
    4
    B
    33
    2
    66
    3
    5
    C
    44
    2
    6
    C
    55
    3
    7
    C
    66
    3
    8
    D
    77
    4
    9
    D
    88
    5
    10
    D
    99
    6
    11
    ------
    ------
    ------
    ------
    ------
    ------
    ------


    This array formula** entered in F2:

    =IFERROR(INDEX(B:B,SMALL(IF($A$2:$A$10=$E$2,ROW($A$2:$A$10)),ROWS(F$2:F2))),"")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Copy across to G2 then down until you get blanks.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    06-15-2015
    Location
    Seattle
    MS-Off Ver
    2013
    Posts
    62

    Re: Vlookup multiple columns

    Sample workbook.xlsx

    This is what is happening and what I need.

    Thanks for all of the advice everyone! I'm learning a lot from these forums and slowly becoming more efficient at excel.

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,256

    Re: Vlookup multiple columns

    Is this what you require?
    Attached Files Attached Files

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Vlookup multiple columns

    Still not real clear.

    Based on the expected result as posted in your sample file, it looks like you want the last (bottom-most) instance of the lookup value (at least, that's how I interpret it!).

    Data Range
    A
    B
    C
    D
    E
    F
    G
    1
    ID
    Thing
    Thing 2
    ------
    ID (From different data)
    Thing (from DD)
    Thing
    2
    123456
    Boston
    Nuttyville
    123456
    Africa
    Uniport
    3
    543212
    abc
    vga
    4
    123432
    xyz
    qwerty
    5
    123456
    Africa
    Uniport


    This formula entered in F2 and copied across to G2:

    =LOOKUP(2,1/($A2:$A5=$E2),B2:B5)
    Last edited by Tony Valko; 06-26-2015 at 06:06 PM. Reason: I don't know how to spell!

+ 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. [SOLVED] VLookup - Single value lookup returning multiple records into multiple columns
    By kllovin in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-07-2014, 05:14 AM
  2. Return multiple columns with vlookup when there are multiple matches
    By elapo21 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-06-2013, 07:11 PM
  3. vlookup - multiple columns
    By baz0912 in forum Excel General
    Replies: 3
    Last Post: 11-19-2009, 08:45 AM
  4. Multiple Columns & VLookup??
    By Tara C. in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-12-2005, 01:05 PM
  5. vlookup for multiple columns
    By MXC in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-04-2005, 06:06 PM

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