+ Reply to Thread
Results 1 to 6 of 6

Excel 2007 : vlookup returning an array of values

  1. #1
    Registered User
    Join Date
    02-24-2012
    Location
    Russia, Moscow
    MS-Off Ver
    Excel 2007
    Posts
    4

    Lightbulb vlookup returning an array of values

    I have an array of records with one value that repeats:
    Key_1 Val_a
    Key_2 Val_b
    Key_1 Val_c
    Key_3 Val_d
    Key_2 Val_e
    Key_1 Val_f
    Key_1 Val_g

    On a different sheet I would like to find and output all records that have Key_1.
    This can be easily done with macros and I am interested about how to do that using standard excel functions.


    Thank you!
    A
    Last edited by NBVC; 02-24-2012 at 01:51 PM.

  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
    52,946

    Re: vlookup returning an array of values

    Did you try a pivot table?
    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
    02-24-2012
    Location
    Russia, Moscow
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: vlookup returning an array of values

    Quote Originally Posted by FDibbins View Post
    Did you try a pivot table?
    unfortunately, that is not possible. the initial data table is automatically generated by internal system.

    I have been thinking about any other function, that will return the row numbers or positions in the array. In this case I will be able to use indirect() function. But my research has gave me no results. Is there any function like the one I have described?

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: vlookup returning an array of values

    Assuming data is in Sheet1, A2:B10 then to get the values from other sheet:

    =IFERROR(INDEX(Sheet2!$B$2:$B$10,SMALL(IF(Sheet1!$A$2:$A$10="Key_1",ROW(Sheet1!$A$2:$A$10)-ROW(Sheet1!$A$2)+1),ROWS($A$1:$A1))),"")

    confirmed with CTRL+SHIFT+ENTER not just ENTER and copied down. Note: You can replace "Key_1" with an input cell reference
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  5. #5
    Registered User
    Join Date
    02-24-2012
    Location
    Russia, Moscow
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: vlookup returning an array of values

    Thanks a lot! That worked.
    Last edited by acallidus; 02-24-2012 at 09:17 AM.

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: vlookup returning an array of values

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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