+ Reply to Thread
Results 1 to 7 of 7

Using Index/Small to return multiple, non-duplicated matches

  1. #1
    Forum Contributor
    Join Date
    09-04-2013
    Location
    USA
    MS-Off Ver
    Excel 365
    Posts
    263

    Using Index/Small to return multiple, non-duplicated matches

    Currently using a Index/Small array formula to return matches to a lookup value. See attached spreadsheet.

    One issue I would like to correct is that I would like to only return unique values, not duplicates (ones that have already been returned in formula) In example, number 5 has the name Eric listed twice in source, and returns it twice in formula (formula in "Before" sheet, cells B2 to D6). Looking to have it returned only once, as shown in sheet "After". Any ideas? Thanks.
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,910

    Re: Using Index/Small to return multiple, non-duplicated matches

    It would be more helpful to show us the results you want, really. What are Index1, Index2 and Index3 and how do they relate to the source data?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Contributor
    Join Date
    09-04-2013
    Location
    USA
    MS-Off Ver
    Excel 365
    Posts
    263

    Re: Using Index/Small to return multiple, non-duplicated matches

    Actually, Sheet "After" does show the results I want...Index 1, 2, and 3 is just the formula copied over horizontally to show any matches based on the number.

    Formula is in the "Before" sheet...
    Last edited by Brawnystaff; 01-08-2017 at 01:53 PM.

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

    Re: Using Index/Small to return multiple, non-duplicated matches

    Try this...

    Data Range
    A
    B
    C
    D
    1
    Number
    Index1
    Index2
    Index3
    2
    1
    Rob
    Ang
    3
    2
    Steve
    4
    3
    Andrea
    5
    4
    Brian
    6
    5
    Eric
    Peter


    This array formula** entered in B2:

    =IFERROR(INDEX($I$2:$I$9,MATCH(0,IF($H$2:$H$9=$A2,COUNTIF($A$2:A2,$I$2:$I$9)),0)),"")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Copy across to D2 then down as needed.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Forum Contributor
    Join Date
    09-04-2013
    Location
    USA
    MS-Off Ver
    Excel 365
    Posts
    263

    Re: Using Index/Small to return multiple, non-duplicated matches

    Thanks, Tony...Had seen that Countif addition in an earlier posting, just wasn't sure how to integrate it into my example.

  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: Using Index/Small to return multiple, non-duplicated matches

    Needs a slight tweak...

    =IFERROR(INDEX($I$2:$I$9,MATCH(0,IF($H$2:$H$9=$A2,COUNTIF($A$2:A2,$I$2:$I$9)),0)),"")
    To:

    =IFERROR(INDEX($I$2:$I$9,MATCH(0,IF($H$2:$H$9=$A2,COUNTIF($A2:A2,$I$2:$I$9)),0)),"")

    Still array entered.

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

    Re: Using Index/Small to return multiple, non-duplicated matches

    You're welcome. Thanks for the feedback!

+ 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. Index matched array with duplicated matches, help needed!
    By hbuzz in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-08-2016, 09:45 AM
  2. [SOLVED] Return multiple matches using index function
    By sbabu16 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-27-2015, 05:01 AM
  3. Index, small, if, row llok up multiple values and return a result
    By 077james86 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-28-2015, 02:31 PM
  4. [SOLVED] Dependent Dropdown List Using Index and Small Won't Return Multiple Values
    By ebevis in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-23-2013, 02:28 AM
  5. return multiple matches using INDEX and SMALL
    By merlyn45 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-31-2013, 05:14 AM
  6. [SOLVED] Optimizing/speeding up a slow INDEX & SMALL function for retrieving multiple matches
    By lesoies in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-07-2012, 11:56 AM
  7. Using Index & Small to return multiple values
    By BHudPE in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-17-2010, 06:06 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