+ Reply to Thread
Results 1 to 8 of 8

lookup list

  1. #1
    Registered User
    Join Date
    01-18-2010
    Location
    Cleveland, OH
    MS-Off Ver
    Excel 2007
    Posts
    54

    lookup list

    I am trying to get excel to return a list of all vlookup results when there is more than 1 instead of just giving me an N/A result. Can I do that within vlookup or is there another way? See my attached example spreadsheet.
    Attached Files Attached Files
    Last edited by loner2003; 03-11-2010 at 12:20 PM. Reason: solved.

  2. #2
    Registered User
    Join Date
    12-30-2009
    Location
    Florida
    MS-Off Ver
    Excel 2007
    Posts
    43

    Re: lookup list

    Would filtering by code 3 ultimately achieve what you are looking for?

  3. #3
    Registered User
    Join Date
    01-18-2010
    Location
    Cleveland, OH
    MS-Off Ver
    Excel 2007
    Posts
    54

    Re: lookup list

    That is really what I want to do, but I want it to occur automatically as a result of a user entry. So if a user inputs a value of 524210 for Code 3 (such as in a registration form where they would be answering questions and completing blank fields manually), I want the results of their entry to filter into a small chart of results that the user will be able to view.

  4. #4
    Registered User
    Join Date
    12-30-2009
    Location
    Florida
    MS-Off Ver
    Excel 2007
    Posts
    43

    Re: lookup list

    I can't think of an easy way. I would most likely employ some code under this circumstance.

  5. #5
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Re: lookup list

    Normally you would have a construction like
    HTML Code: 
    if it was a single (first) lookup. As it is the Nth I would use
    HTML Code: 
    Where this is the code
    Please Login or Register  to view this content.
    Looking for great solutions but hate waiting?
    Seach this Forum through Google

    www.Google.com
    (e.g. +multiple +IF site:excelforum.com/excel-general/ )

    www.Google.com
    (e.g. +fill +combobox site:excelforum.com/excel-programming/ )

    Ave,
    Ricardo

  6. #6
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Re: lookup list

    On the Ozgrid they tackle it as such:
    Please Login or Register  to view this content.
    Your use: =Nth_Occurrence($E$2:$E$16, "524210", 1, 0, -3)

    http://www.ozgrid.com/Excel/find-nth.htm

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: lookup list

    In this type of setup any formula based approach is always going to be messy and is unlikely to offer the same flexibility of a UDF - this is partly down to the layout of the source data.

    Golden rule is to avoid repetitive calculations and that will be adopted in below.

    If we assume for sake of argument / demo that using the sample file B21 holds code3 of interest: 524210

    First - identify the number of records that should be returned in results table:

    Please Login or Register  to view this content.
    In this case that will be 2.

    Next - identify the row(s) on which the n instances are to be found:

    Please Login or Register  to view this content.
    (I used 27 to account for possibility of 5 matches - you should adjust as neccessary)

    We use A23:A27 to generate the results table (specifically to avoid [expensive] repetitive calcs)

    Please Login or Register  to view this content.

    Changing B21 to 531120 you should get 5 records returned
    Last edited by DonkeyOte; 03-11-2010 at 09:27 AM. Reason: Ricardo pointed out typo in my COUNTIF range (E not C) - thanks Ricardo :)

  8. #8
    Registered User
    Join Date
    01-18-2010
    Location
    Cleveland, OH
    MS-Off Ver
    Excel 2007
    Posts
    54

    Re: lookup list

    Thanks all. SOLVED.

+ 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