How to extract top five values in excel using index, match, and large [closed]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



How to extract top five values in excel using index, match, and large [closed]



How do I extract the top five values in an excel column? This is what I have so far:


=INDEX($E$3:$E$143,MATCH(1,INDEX(($AH$3:$AH$143=LARGE($AH$3:$AH$143,ROWS(AJ$28:AJ28)))*(COUNTIF(AJ$28:AJ28,$E$3:$E$143)=0),),0))



table


Customer name Contract Date Contract age Oldest Cotracts

Bill 8/1/18 5 bill
John 8/2/18 4 john
David 8/3/18 3 David



The formula i have above is in the cell to the right where bill's name is. But it is not taking into consideration ties and is populating "N/A'



Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.





It would be easier if you mocked up some data similar to yours, only including the columns that are needed, with the desired outcome. Pleas edit your post to include a minimal example of your data.
– Scott Craner
Aug 6 at 16:33





scott i have been a member for all of 5 minutes lol. I may need some help doing that
– JBUNKER2010
Aug 6 at 16:38





You might start be reading how to ask
– James Jenkins
Aug 6 at 16:41





use edit to put the new data in the original post, not the comments.
– Scott Craner
Aug 6 at 16:48





create the table in excel. copy and paste all the data at one time, so the data shows up in the edit as a small table, not one column.
– Scott Craner
Aug 6 at 16:50




1 Answer
1



You will need to add a column that retreives the top five contract age using LARGE:


=LARGE(C:C,ROW(1:1))



enter image description here



Then refering to that you would use:


=INDEX(A:A,AGGREGATE(15,6,ROW($C$2:$C$19)/($C$2:$C$19=E2),COUNTIF($E$2:E2,E2)))



enter image description here



with older version of Excel use this array formula:


=INDEX(A:A,SMALL(IF($C$2:$C$19=E2,ROW($C$2:$C$19)),COUNTIF($E$2:E2,E2)))



Being an array formula it needs to be confirmed with Ctrl-Shift-Enter instead of Enter when exiting edit mode.





so what would the whole formula look like scott? thank you for the help by the way
– JBUNKER2010
Aug 6 at 20:20





It can't be done in one formula, when there are duplicates. Hence the need for the helper column.
– Scott Craner
Aug 6 at 20:21





nevermind on the previous comment. I get it now. One question though. after aggregate what does the 15 and 6 represent?
– JBUNKER2010
Aug 6 at 20:27





15 is "SMALL" and 6 is "IGNORE ERRORS"
– Scott Craner
Aug 6 at 20:30





GETTING A #NAME? error
– JBUNKER2010
Aug 6 at 20:31

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard