+ Reply to Thread
Results 1 to 9 of 9

Return Nth Match Using Index Match

  1. #1
    Registered User
    Join Date
    02-24-2015
    Location
    Houston, TX
    MS-Off Ver
    2013 and 2010
    Posts
    26

    Return Nth Match Using Index Match

    I'm sure this has been asked before and I tried searching for the answer in this forum and google...

    i want to return the first, second, third... nth match using index match. i feel like this should be a lay up..

    my formula currently looks something like this


    =index("All Store Info", Small(index(match("Zip Code",Array of Zip Codes,0),0),nth),match("Store",Array of Stores,0))


    I'm looking for all stores in a particular zip code


    Thanks

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Return Nth Match Using Index Match

    Since you need to return multiple values you would need something different an array formula

    You need to make changes to this formula template and replace text with real ranges

    =IFERROR(INDEX("All Store Info",SMALL(IF("Zip Codes"="Zip Code",ROW("Zip Codes")),ROWS(B$2:B2))),"")


    ***Array formula must be entered by using key combination of CTRL+SHIFT+ENTER and not just ENTER

    If still have trouble transposing this to real formula please upload workbook sample.
    Last edited by AlKey; 04-17-2015 at 05:53 PM.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Registered User
    Join Date
    02-24-2015
    Location
    Houston, TX
    MS-Off Ver
    2013 and 2010
    Posts
    26

    Re: Return Nth Match Using Index Match

    Thank you for your feedback. Here is the new (your) formula with ranges.

    =INDEX('Open Stores'!$A$2:$AF$2248,SMALL(IF('Store Info by State'!$I7='Open Stores'!AD2,ROW('Open Stores'!$AD$2:$AD$2248)),ROW('Open Stores'!$AD$2:AD3)))

    I'm getting an #NUM error

    This is as an array formula too. {}

    Thanks

  4. #4
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Return Nth Match Using Index Match

    Here is an example

    =IFERROR(INDEX($A:$A,SMALL(IF($C$2:$C$10=12532,ROW($C$2:$C$10)),ROWS(B$2:B2))),"")

    Row\Col
    A
    B
    C
    1
    Store Stores within a Zip cdoe Zip Codes
    2
    Store1 Store3
    14532
    3
    Store2 Store6
    12452
    4
    Store3 Store8
    12532
    5
    Store4
    14532
    6
    Store5
    12452
    7
    Store6
    12532
    8
    Store7
    12452
    9
    Store8
    12532
    10
    Store9
    10390

  5. #5
    Registered User
    Join Date
    02-24-2015
    Location
    Houston, TX
    MS-Off Ver
    2013 and 2010
    Posts
    26

    Re: Return Nth Match Using Index Match

    =INDEX('Open Stores'!$B$2:$B$2248,SMALL(IF('Open Stores'!$AD$2:$AD$2248=AI$3,ROW('Open Stores'!$AD$2:$AD$2248)),ROWS(AI$6:AI6)))

    Column B is the List of Stores. Column AD is the list of respective Zip Codes for those stores. AI3 is the Zip Code. AI6 is where I want the list of stores in that Zip Code to go.

    I get a FALSE for the IF logical test; however, I know there are two stores in that Zip Code.

    Thanks

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

    Re: Return Nth Match Using Index Match

    Quote Originally Posted by gtbaseball7 View Post
    =INDEX('Open Stores'!$B$2:$B$2248,SMALL(IF('Open Stores'!$AD$2:$AD$2248=AI$3,ROW('Open Stores'!$AD$2:$AD$2248)),ROWS(AI$6:AI6)))
    Reference the entire column B in the INDEX function:

    =INDEX('Open Stores'!$B:$B,SMALL(IF('Open Stores'!$AD$2:$AD$2248=AI$3,ROW('Open Stores'!$AD$2:$AD$2248)),ROWS(AI$6:AI6)))

    Still array entered.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  7. #7
    Registered User
    Join Date
    02-24-2015
    Location
    Houston, TX
    MS-Off Ver
    2013 and 2010
    Posts
    26

    Re: Return Nth Match Using Index Match

    It is not working... Please see attachment.

    Thank you!
    Attached Files Attached Files

  8. #8
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,371

    Re: Return Nth Match Using Index Match

    Please see this file hope this works
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    02-24-2015
    Location
    Houston, TX
    MS-Off Ver
    2013 and 2010
    Posts
    26

    Re: Return Nth Match Using Index Match

    Azumi,

    This worked perfectly! Thank you!

    Thank you all for your help!

+ 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: 5
    Last Post: 10-16-2016, 02:33 AM
  2. [SOLVED] Vlookup/index/match to return all values that match
    By Asil01 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-09-2014, 12:49 PM
  3. [SOLVED] Combining 3 Formulas: Return all Names that Match Criteria Using Index/Match
    By bchilme in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 09-29-2014, 09:28 AM
  4. VLOOKUP/INDEX/MATCH to return all values that match
    By lijia00 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-05-2014, 11:56 AM
  5. Replies: 3
    Last Post: 05-08-2013, 02:10 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