+ Reply to Thread
Results 1 to 7 of 7

Avoiding Duplicate Values when using INDEX/MATCH

  1. #1
    Registered User
    Join Date
    09-14-2015
    Location
    British Columbia, Canada
    MS-Off Ver
    MS Office 2013
    Posts
    5

    Avoiding Duplicate Values when using INDEX/MATCH

    Hi all, really hoping someone here can assist. I have a large dataset of weather observations, then have a Summary sheet that finds the top 10 values for each category. I then need to find the corresponding Station Name for that given top 10 value. My challenge is that there can be duplicate values in the top 10 list. When I use VLOOKUP or INDEX/MATCH to find the corresponding station, it only lists one station for all the duplicate values in my top ten list. How can I get it to find the next station that corresponds to the first duplicate value, instead of seemingly stalling at the first occurrence of that value it finds? I've tried sticking an IF function in there to compare the station it's computing to the previous station, but still can't figure out how to get it to kick down to the next station in the list that has that duplicate value. (all I can get it to return is a basic value like ND, for example)

    In this example, the 24 actually corresponds to 4 different stations, instead of just the one... but once it hits Middle Lake alphabetically, it refuses to look further. The formula I'm using is

    =INDEX(Analysis!$I:$I,MATCH(Summary!G7,Analysis!C:C,0))

    I feel like I'm missing something really obvious here...

    excel1.GIF

  2. #2
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Avoiding Duplicate Values when using INDEX/MATCH

    Hi,
    see attached example. the trick is to use a helper column to add a small increment to each value to make them unique.
    Then you can use the Index/Match function...
    Attached Files Attached Files
    GC Excel

    If this post helps, then click the star icon (*) in the bottom left-hand corner of my post to Add reputation.

  3. #3
    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,936

    Re: Avoiding Duplicate Values when using INDEX/MATCH

    Hi, welcome to the forum

    I feel like I'm missing something really obvious here...
    No, you are not. INDEX/MATCH and VLOOKUP() will always stop looking once they have found a match, thats just teh way they work. There are a few ways around that, one of them is by using a helper as described by GC above
    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

  4. #4
    Registered User
    Join Date
    09-14-2015
    Location
    British Columbia, Canada
    MS-Off Ver
    MS Office 2013
    Posts
    5

    Re: Avoiding Duplicate Values when using INDEX/MATCH

    Thanks for the welcome! I suspect I'll be back with more questions as I have caught a bit of an Excel bug.

    The helper column has worked like a charm, thank you GC Excel! And I've learned a new function (the ROW function), so a win all around! It took me a second to wrap my brain around what you were doing until I figured out what that ROW function did, haha!

    Now if I could just get rid of the stupid lag in 2013, I'd be a happy camper...

    Cheers!

  5. #5
    Registered User
    Join Date
    07-21-2016
    Location
    London
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2302 Build 16.0.16130.20806) 64-bit
    Posts
    94

    Re: Avoiding Duplicate Values when using INDEX/MATCH

    Hi There,

    I have a similar issue with my file. i have a list of Clients and it have fees attained by individuals for these clients. I have a slicer that allows you to select the names of these individuals and based on that I need a dynamic list of clients.
    I have used the following formula:

    {=IFERROR(INDEX(data!$A:$A,SMALL(IF(data!$D:$D='Summary 2'!$G$2,ROW(data!$A:$A)),ROW(1:1))-1,1),"")}

    Where data A:A = the list of Clients
    Where data D:D = the list of individual
    Where 'summary 2'!G2 is the criteria i.e. the name of the individual

    When using this formula, I am getting duplicate entries in the list, for example:

    JOhn smith - Criteria

    Client name
    Client 1
    Client 1
    Client q
    Client q

    Is there anything I can add to the formula to stop this from happening?

    Thanks so much

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,731

    Re: Avoiding Duplicate Values when using INDEX/MATCH

    You shouldn't really ask your own question in someone else's thread - See Rule 01 on hijacking at the top of the screen.

    You should start your own thread, and it would help if you attached a sample Excel workbook to that thread (yellow banner at the top of the screen explains how to do this). You can have a link back to this thread if you think it is relevant.

    Hope this helps.

    Pete

  7. #7
    Registered User
    Join Date
    07-21-2016
    Location
    London
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2302 Build 16.0.16130.20806) 64-bit
    Posts
    94
    Quote Originally Posted by Pete_UK View Post
    You shouldn't really ask your own question in someone else's thread - See Rule 01 on hijacking at the top of the screen.

    You should start your own thread, and it would help if you attached a sample Excel workbook to that thread (yellow banner at the top of the screen explains how to do this). You can have a link back to this thread if you think it is relevant.

    Hope this helps.

    Pete
    My sincerest apologies, Pete, I’ll be sure to start a new thread

+ 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. [SOLVED] Sum Duplicate Index-match-match Values
    By djh30 in forum Excel General
    Replies: 3
    Last Post: 01-06-2015, 11:27 PM
  2. [SOLVED] Index Match - Avoiding Duplicate Results
    By Aphalite in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-04-2014, 08:12 PM
  3. Index Match with Duplicate Values
    By js2178a in forum Excel General
    Replies: 2
    Last Post: 09-28-2014, 02:21 AM
  4. index match with duplicate values - how to get latest value
    By helpme10 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-29-2013, 02:13 PM
  5. [SOLVED] Index and match functions for duplicate values
    By JBERK in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 10-23-2012, 10:48 AM
  6. Index/Match where data has duplicate values
    By ragatha in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-06-2012, 12:09 PM
  7. Excel, Match/Index when duplicate values?
    By Fizziii in forum Excel General
    Replies: 0
    Last Post: 01-18-2011, 02:12 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