+ Reply to Thread
Results 1 to 3 of 3

vlookup with one reference, and return with multiple values

  1. #1
    Registered User
    Join Date
    04-21-2015
    Location
    HK
    MS-Off Ver
    2007
    Posts
    40

    vlookup with one reference, and return with multiple values

    Hi guys,

    I have a problem related to a reference code with several cells in return.
    vlookup can only get one result as return.

    Is there any method to return multiple values with one reference code?


    here is my example and expected result.
    thank you guys ..!!
    Attached Files Attached Files
    Last edited by nth34; 05-04-2015 at 02:21 AM.

  2. #2
    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
    53,049

    Re: vlookup with one reference, and return with multiple values

    If you are prepared to swing your table around, we can do it this way...
    G
    H
    I
    J
    14
    D001 D002 D003 D004
    15
    P001 P008 P006 P110
    16
    P005
    17
    P009
    18
    19

    G15=IFERROR(INDEX($E$2:$E$7,SMALL(IF($D$2:$D$7=G$14,ROW($E$2:$E$7)-1),ROWS($A$1:A1))),"")
    copied down and across. This is an ARRAY formula...

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
    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

  3. #3
    Registered User
    Join Date
    04-21-2015
    Location
    HK
    MS-Off Ver
    2007
    Posts
    40

    Re: vlookup with one reference, and return with multiple values

    Quote Originally Posted by FDibbins View Post
    If you are prepared to swing your table around, we can do it this way...
    G
    H
    I
    J
    14
    D001 D002 D003 D004
    15
    P001 P008 P006 P110
    16
    P005
    17
    P009
    18
    19

    G15=IFERROR(INDEX($E$2:$E$7,SMALL(IF($D$2:$D$7=G$14,ROW($E$2:$E$7)-1),ROWS($A$1:A1))),"")
    copied down and across. This is an ARRAY formula...

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
    If i wish i can turn row 14 into column
    like
    D001 P001 P005 P009
    D002 P008
    D003 P006
    D004 P110

    How do i change the array?
    Thank you so much for your time and answer!!
    its brilliant!!

+ 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. Replies: 13
    Last Post: 10-13-2014, 02:00 AM
  2. [SOLVED] Return Multiple Values Off One Reference
    By BobBing in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-29-2012, 03:43 PM
  3. [SOLVED] Return Multiple Values based on a single reference point
    By qfalker in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-20-2012, 01:00 PM
  4. Replies: 3
    Last Post: 05-09-2012, 06:22 PM
  5. Replies: 1
    Last Post: 04-24-2012, 03:02 AM

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