How can I get top 10 from a table and sorted from highest to lowest.
Return Top N Values using Index Function
function - Top 10 values in excel - Stack Overflow
How to Return Top 3 Values and Their Corresponding Cell
Videos
Hi all, sometime back I had seen a YT video that had a neat solution to returning top N rows using the Index function, however, I am not able to find it again. I don't know if I remember it wrong or if that it is actually possible but it's eating my brain up so I thought I'd ask it here.
So the problem is this. Let's say I have data in A1:B10 and I want to return the top 5 values using the Index function.
I can use this formula - =INDEX(A12#,{1;2;3;4;5},0)
But is there a way so I can reference in the formula 1 to 5 directly instead of using semi-colons?
Edit: I am not looking to get top 5 highest values or lowest values. I am just looking to get the top 5 rows in an array. The goals is to for example, wrap it around a filter function that outputs an array to only display Top N results.
Secondly, the solution I remember seeing had an operator that replaced {1;2;3;4;5} in the formula with something shorter and dynamic, so that is specifically what I was aiming for. It is not a problem I am looking to solve currently, just curious as it was something that I hadn't seen before.
You can use Large with Match and Index to get the list:-
See the image of my example. I have used dummy values.
Step1 :- Use this formula (I have used in D column 'Top 10')
=INDEX($A$2:$B$13,MATCH(LARGE($B$2:$B$13,ROW(1:1)),$B$2:$B$13,0),1)
Step2:- Then drag this formula down for 10 rows. You will get the top 10.
Let me know if you have any questions
Try the rank functions.The original RANK has been deprecated. You can use RANK.EQ instead.
The syntax is
=RANK.EQ(value, entireRangeOfValues).
e.g. =RANK.EQ(J2,$J$2:$J$8015,0)
The last parameter allows you to specify sort order.
Depending on your needs you can also look at RANK.AVG These differ in how they rank duplicate values.
Hi Grill
Try the following approach and formulas
Rank column =RANK.EQ(C2,$C$2:$C$26,0)+COUNTIF($C$2:C2,C2)-1
Total Sales =VLOOKUP($F2,$A$1:$C$26,3,FALSE)
Division =VLOOKUP($F2,$A$1:$C$26,2,FALSE)
I hope this helps you and gives a solution to your problem
Do let me know if you need more help
Regards
Jeovany
Hi,
In cell E2, enter this formula
=FILTER(A2:B8,RANK(B2:B8,B2:B8,0)<=3)
Hope this helps.