+ Reply to Thread
Results 1 to 7 of 7

Using INDEX MATCH and dealing with duplicate ranked values returned

  1. #1
    Registered User
    Join Date
    05-30-2013
    Location
    England
    MS-Off Ver
    Excel Mac V16.68 and Excel 2019
    Posts
    33

    Using INDEX MATCH and dealing with duplicate ranked values returned

    Hi Everyone,
    I'm struggling with how to solve this and not sure if it's possible by using the formula. I think there will only be 2 duplicate values maximum.

    I'm attaching a screenshot of a simplified version of the sheet and wonder if anyone can see if it's possible to overcome the duplicate values returned issue as my brain is melting down :D

    screen.jpg

    Cells C4 - C8 I'm trying to show the 'top 5' largest results in order from the data in F4 - G14.

    It all works, apart from if a value in column G is a duplicate value (ie they are both ranking joint 3rd with a value of "20" in this case, it gets confused and just puts "Agricultural Products" in C6 and C7 instead of "Agricultural Products" and "Air Freight & Logistics" (in 3rd or 4th, either way).

    (In case it helps, for example, D6 contains the formula:
    =INDEX($G$4:$G$14, MATCH(LARGE($G$4:$G$14, B6), $G$4:$G$14, 0))

    and C6 contains:

    =INDEX($F$4:$F$14, MATCH(LARGE($G$4:$G$14, B6), $G$4:$G$14, 0))

    I'm stuck and can't work it out and wondered if there's any clever trick or workaround anyone might be able to point me in the right direction? My brain is mush now

    Any help greatly appreciated,

    All the best,
    Paul
    Attached Files Attached Files
    Last edited by atombomb99; 11-19-2022 at 12:32 PM. Reason: Added sample xlsx

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

    Re: Using INDEX MATCH and dealing with duplicate ranked values returned

    There are instructions at the top of the page explaining how to attach your sample workbook. Screenshots are of little practical use as we cannot manipulate them.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. It also has expected results mocked up, worked examples where required, relevant cells highlighted and a few explanatory notes.

    Administrative Note:

    Is your forum profile showing the version of Excel that you need this to work for?

    Members will tailor the solutions they offer to the version of Office (Excel, NOT Windows) that you have. Please check that your forum profile is up-to-date in this respect. If you aren't sure, in Excel go to File | Account and report what it says below the MS logo at the top of that page. If your version is for Mac, please also state this.

    The three most recent versions of Excel are Excel 2019, Excel 2021 and MS365 - if you are using MS365, please give this name along with the release number in your profile (e.g. MS365 Version 2211). This is in the About Excel section further down the Account page.

    Thanks.
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    05-30-2013
    Location
    England
    MS-Off Ver
    Excel Mac V16.68 and Excel 2019
    Posts
    33

    Re: Using INDEX MATCH and dealing with duplicate ranked values returned

    Thankyou Ali, I've updated and attached a working sample.

    Best Regards,
    Paul

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,879

    Re: Using INDEX MATCH and dealing with duplicate ranked values returned

    In H4 and copy down

    =RANK(G4,$G$4:$G$14)++COUNTIF($G$4:G4,G4)-1

    in C4 and copy across and down

    =INDEX(F$4:F$14, MATCH(SMALL($H$4:$H$14,$B4), $H$4:$H$14, 0))
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  5. #5
    Registered User
    Join Date
    05-30-2013
    Location
    England
    MS-Off Ver
    Excel Mac V16.68 and Excel 2019
    Posts
    33

    Re: Using INDEX MATCH and dealing with duplicate ranked values returned

    Wow, thank you John, that is literally mind-blowing! Is helper column H counting how far down and returning a rank value? That's amazing! How does it work in layman's terms?

    If wanted to to repeat it, but show the bottom 5 smallest values, would I just change somehow column H formula, or the other places?

  6. #6
    Registered User
    Join Date
    01-20-2020
    Location
    Gridley, ILL
    MS-Off Ver
    2021
    Posts
    28

    Re: Using INDEX MATCH and dealing with duplicate ranked values returned

    Make a column for Rank in column H. In H4 enter =RANK(G4,$G$4:$G$14,0)+COUNTIF($G$4:G4,G4)-1 and copy down. (Not my formula)
    In C4 enter =INDEX($F$4:$F$14, MATCH(B4,$H$4:$H$14,0)) where you are seaching for the rank.

  7. #7
    Registered User
    Join Date
    05-30-2013
    Location
    England
    MS-Off Ver
    Excel Mac V16.68 and Excel 2019
    Posts
    33
    Thanks both, all adapted and working a treat

+ 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] Multiple Ranked Returns from Match and Index with same value (duplicate)
    By silentcarl in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-13-2019, 12:10 PM
  2. [SOLVED] Sum duplicate values returned by array formula INDEX(MATCH(LARGE(IF)))
    By TFiske in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 12-02-2017, 07:18 PM
  3. [SOLVED] INDEX-MATCH: Dealing with missing lookup values
    By Big.Moe in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-19-2017, 02:08 AM
  4. [SOLVED] Values not returned by Index, Match when using values from Data Validation
    By Avinashch in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-10-2015, 10:34 AM
  5. Index Match returning values when none should be returned
    By Khaos1208 in forum Excel General
    Replies: 6
    Last Post: 04-27-2014, 04:48 PM
  6. displaying ranked values that are returned from COUNTIFS
    By HyZaret in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-17-2014, 07:52 PM
  7. Duplicate values returned using Index Match Lookup with Small()
    By jacob@thepenpoint in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-18-2013, 10:48 AM

Tags for this Thread

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