+ Reply to Thread
Results 1 to 18 of 18

vlooking shows only the first match. How to keep on looking?

  1. #1
    Registered User
    Join Date
    06-06-2013
    Location
    montreal
    MS-Off Ver
    Excel 2003
    Posts
    19

    vlooking shows only the first match. How to keep on looking?

    So the title of the thread says it all:

    vlooking shows only the first match. But should there be more than one matching value, how to tell excell to keep looking thu the whole matrix until a match before reporting the same as the first result?

    ie

    1112 a
    1112 e

    Vlookup, seems to always give "a" as result.

    How do I tell excel to keep looking until it finds "e"?

    Thanks again!

  2. #2
    Valued Forum Contributor
    Join Date
    10-10-2012
    Location
    New York
    MS-Off Ver
    Excel 2007/2010
    Posts
    337

    Re: vlooking shows only the first match. How to keep on looking?

    Vlookup and Index-match formulas will only ever return the first instance they comes across. They are "dumb" functions that will stop once it's search criteria is met. This is why you need to have unique reference values.
    Don't just use the answers provided for you. Try to understand how it works by reverse engineering or asking about it.

    Please mark the thread as [SOLVED] (Thread Tools->Mark thread as Solved) when answered.
    If you're happy with an answer given, please click the * under the person's name to boost their reputation.

  3. #3
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: vlooking shows only the first match. How to keep on looking?

    array formula index/small/if -ctrl+shift+enter NOT just enter

    1112.xlsx -excel 2007/above

    1112xl2003.xls - lower version



    Note: Thanks Marvin
    Last edited by vlady; 06-07-2013 at 09:56 PM.
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: vlooking shows only the first match. How to keep on looking?

    Hey Vlad,

    You should have saved your file as a .xls instead of a .xlsx as the OP is using 2003 Excel. Make sense?
    My guess is they won't be able to see your work because of the older version of Excel.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  5. #5
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: vlooking shows only the first match. How to keep on looking?

    my bad, i didn't notice that, thanks.

  6. #6
    Valued Forum Contributor
    Join Date
    10-10-2012
    Location
    New York
    MS-Off Ver
    Excel 2007/2010
    Posts
    337

    Re: vlooking shows only the first match. How to keep on looking?

    I've clearly been put in my place and shown that it's somewhat possible. I don't see the utility in this however. May as well save the trouble of creating this formula and just use filters/sorts. That's just my opinion though.

  7. #7
    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: vlooking shows only the first match. How to keep on looking?

    Craig, dont think of it that way, rather that you have learned a new technique - with excel that happens to every-one, all the time
    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

  8. #8
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: vlooking shows only the first match. How to keep on looking?

    Hey Craig,

    I agree with you on using filters and sorts (most of the time). When I try to create long SumProduct or CSE formulas it makes me dizzy. I believe a simple filter and/or sort will do a lot of these problems that are asked....

    That being said.. I had to learn what these smart guys were doing with SumProduct and Array Formulas so I wouldn't feel stupid. I'm a lot better with them now but still prefer Sort and Filter. I really like Pivot Tables instead of SumProducts....

  9. #9
    Registered User
    Join Date
    05-04-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    6

    Lightbulb Re: vlooking shows only the first match. How to keep on looking?

    Hi Mega_gerry,

    I have solution for you.

    =IFERROR(INDEX($L:$L,SMALL(IF($K$2:$K$60478=$A2,ROW($K$2:$K$60478)),COLUMNS($B2:B2))),"")

    for example see the attached file.

    if found my solution usefull to you then
    CLICK the STAR * icon on the left side below my user name to say thank you.
    Attached Files Attached Files

  10. #10
    Valued Forum Contributor
    Join Date
    10-10-2012
    Location
    New York
    MS-Off Ver
    Excel 2007/2010
    Posts
    337

    Re: vlooking shows only the first match. How to keep on looking?

    @ FD & Marvin - Please don't get me wrong. I like to reverse engineer the solutions provided, by those better versed in excel than I am, in hopes of remembering how/when to use it. I don't want to hijack this thread, so I'll just say I definitely learned from the solution Vlady gave.

    Cheers

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

    Re: vlooking shows only the first match. How to keep on looking?

    Quote Originally Posted by Craig K. View Post
    I don't see the utility in this however. May as well save the trouble of creating this formula and just use filters/sorts.
    You may want the extracted data to appear on a different sheet or in a different file.

    You might want this to be dynamic based on other user inputs or other formulas.

    You might want to use this data as the selections in a drop down list.

    This type of question is asked frequently.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  12. #12
    Registered User
    Join Date
    06-06-2013
    Location
    montreal
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: vlooking shows only the first match. How to keep on looking?

    Thanks all for your help!

    I have quite a few interesting leads here.
    I am still working on this.

    Not sure I have fully debugged it.
    I need to be able to find the next match, but keep it aligned with the original row, instead of just a list of options.
    Any thoughts?

    Thanks again

  13. #13
    Valued Forum Contributor
    Join Date
    10-10-2012
    Location
    New York
    MS-Off Ver
    Excel 2007/2010
    Posts
    337

    Re: vlooking shows only the first match. How to keep on looking?

    Are you trying to find if a specific value shows up for each number? Example: did "e" occur 1112?

  14. #14
    Registered User
    Join Date
    06-06-2013
    Location
    montreal
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: vlooking shows only the first match. How to keep on looking?

    Not really,

    I have for instance: (numbers in column A, letters in cloumn B)
    1495 E
    1021 F
    1495 S
    1145 R
    1495 T

    The vlookup finds the 1st 1495 and reports E
    but does not report S OR T since it always stops at the fisrt 1495.

  15. #15
    Valued Forum Contributor
    Join Date
    10-10-2012
    Location
    New York
    MS-Off Ver
    Excel 2007/2010
    Posts
    337

    Re: vlooking shows only the first match. How to keep on looking?

    What do you want your output to look like then?

  16. #16
    Registered User
    Join Date
    06-06-2013
    Location
    montreal
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: vlooking shows only the first match. How to keep on looking?

    should look like this. see attached.

    I am simply comparing 2 sets of data, and need to see if they match or not.
    thanks
    Attached Files Attached Files

  17. #17
    Valued Forum Contributor
    Join Date
    10-10-2012
    Location
    New York
    MS-Off Ver
    Excel 2007/2010
    Posts
    337

    Re: vlooking shows only the first match. How to keep on looking?

    It looks like you want a simple side-by-side comparison and for any differences to be highlighted.

  18. #18
    Registered User
    Join Date
    06-06-2013
    Location
    montreal
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: vlooking shows only the first match. How to keep on looking?

    more or less. It's not that simple.

    some numbers might not exist in one list but yes in the other.
    and the numbers that are repeated still need to find a match. That's the mayor problem I have.

+ 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