+ Reply to Thread
Results 1 to 10 of 10

Problem Using LARGE formula with Index/Match to pull values when there are Duplicates

  1. #1
    Registered User
    Join Date
    07-18-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    48

    Problem Using LARGE formula with Index/Match to pull values when there are Duplicates

    Good Morning,

    I am attempting to use the LARGE formula to pull the top 3-5 percentages out of a field of 50-100, while using the INDEX/MATCH function to pull the corresponding "descriptor" that is associated with those top 3-5 percentages. (I need to do this across multiple data sets, but I can't get past this 'duplicate' issue) However, I am running into the problem when there are 2 percentages that are identical (WH 14 and WH 16 in pasted text below), then the INDEX/MATCH function only pulls the 1st "descriptor" and doesn't continue down to the Duplicate. I am stuck as to how to tell excel to move to the next set of duplicate data and match the 'descriptor' to that data? I appreciate any/all help!

    I have attached a file that should show what I am trying to do. These are the formulas I am using right now, pulled down into the 3 cells below them to get the top 3.

    B1:
    Please Login or Register  to view this content.
    C1:
    Please Login or Register  to view this content.

    Warehouse S/S %
    WH 1 50.00%
    WH 2 57.14%
    WH 3 0.00%
    WH 4 50.00%
    WH 5 100.00%
    WH 6 60.00%
    WH 7 33.33%
    WH 8 66.67%
    WH9 60.00%
    WH 10 63.64%
    WH 11 78.57%
    WH 12 55.56%
    WH 13 42.86%
    WH 14 71.43%
    WH 15 61.54%
    WH 16 71.43%
    Attached Files Attached Files

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Problem Using LARGE formula with Index/Match to pull values when there are Duplicates

    I reckon one of the formula gurus here will have a better answer but this seems to work
    c4: =IF(COUNTIF(B$3:B4,B4)=1,INDEX($A$50:$A$65,MATCH($B4,$B$50:$B$65,0)),INDEX($A$50:$A$65,SMALL(IF($B$50:$B$65=B4,ROW($B$50:$B$65)-ROW($B$49),""),COUNTIF(B$3:B4,B4))))
    array entered with ctrl+shift+enter

    see workbook attached
    Attached Files Attached Files
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Registered User
    Join Date
    07-18-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: Problem Using LARGE formula with Index/Match to pull values when there are Duplicates

    Thank you! That works great! I am relatively new to larger formulas, and especially CSE formulas. If you have the time, could you explain briefly what you did, as I am having a challenging time putting together how the formula works?

    Thanks again.

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Problem Using LARGE formula with Index/Match to pull values when there are Duplicates

    =IF(COUNTIF(B$3:B4,B4)=1,INDEX($A$50:$A$65,MATCH($B4,$B$50:$B$65,0))...
    the first section checks if it is the first time the percentage has appeared in the ranking list and if so it uses your original formula

    INDEX($A$50:$A$65,SMALL(IF($B$50:$B$65=B4,ROW($B$50:$B$65)-ROW($B$49),""),COUNTIF(B$3:B4,B4))))

    the bold section returns all the row numbers that match the percentage in question and subtracts the row above the table to convert the row numbers into 1, 2, 3 etc to use in the INDEX formula.
    the COUNTIF part is used by the SMALL function so if it's the second time the percentage has appeared in the ranking the formula uses the 2nd lowest row number and so on

    does that help explain it?

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

    Re: Problem Using LARGE formula with Index/Match to pull values when there are Duplicates

    Hi BDavis and welcome to the forum (I guess this is twice for you...)

    A pivot table answer will work for you. In Pivots there is a Top.. Value Filter to do what you want. See the attached for the Pivot Table answer. No formulas needed.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  6. #6
    Registered User
    Join Date
    07-18-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: Problem Using LARGE formula with Index/Match to pull values when there are Duplicates

    Yes, Thank you, that helps a lot. If I want to use this formula on another set of data that will be right next to the original set, I can just modify the 'absolute' cells you have marked, correct? Will I have to modify anything further?

    Thanks again for your help!

  7. #7
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Problem Using LARGE formula with Index/Match to pull values when there are Duplicates

    yes that oughta work. post back if you get stuck and we'll fix it :-)

  8. #8
    Registered User
    Join Date
    07-18-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: Problem Using LARGE formula with Index/Match to pull values when there are Duplicates

    Thanks MarvinP! I will definitely use this option as well on the other sets of data I have to sort this way! I really appreciate the help!

  9. #9
    Registered User
    Join Date
    08-11-2014
    Location
    Thailand
    MS-Off Ver
    2010
    Posts
    1

    Re: Problem Using LARGE formula with Index/Match to pull values when there are Duplicates

    Hi,
    I have downloaded the attached file posted by JosephP. But after clicking & enter on cell "C6", I get an error "#VALUE!", looking the formula, there is "{...........}", i don't know if it's related or not.
    I'm trying to redo the attached excel file, converting the format, currently the data is presented in vertical, while i need it in horizontal form.
    Can someone remake the attached excel file with two sheets, first one vertically and the second horizontally

    Please help...
    Thanks
    Last edited by kitthada; 08-11-2014 at 01:50 PM.

  10. #10
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: Problem Using LARGE formula with Index/Match to pull values when there are Duplicates

    @kitthada,
    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.
    Ben Van Johnson

+ 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