Top 10%, top 10 and above a threshold.

Graham C1600

Board Regular
Joined
Feb 17, 2018
Messages
96
Office Version
  1. 365
Hi,

Suppose I have a list as per below :-

[TABLE="width: 300"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]Graham[/TD]
[TD]1[/TD]
[TD]12[/TD]
[TD]5[/TD]
[TD]12[/TD]
[/TR]
[TR]
[TD]Simon[/TD]
[TD]1[/TD]
[TD]32[/TD]
[TD]4[/TD]
[TD]332[/TD]
[/TR]
[TR]
[TD]Richard[/TD]
[TD]4[/TD]
[TD]43[/TD]
[TD]6[/TD]
[TD]23[/TD]
[/TR]
[TR]
[TD]Brendan[/TD]
[TD]6[/TD]
[TD]12[/TD]
[TD]34[/TD]
[TD]45[/TD]
[/TR]
[TR]
[TD]Sarah[/TD]
[TD]8[/TD]
[TD]45[/TD]
[TD]77[/TD]
[TD]33[/TD]
[/TR]
[TR]
[TD]Stephen[/TD]
[TD]5[/TD]
[TD]32[/TD]
[TD]43[/TD]
[TD]45[/TD]
[/TR]
[TR]
[TD]Taylor[/TD]
[TD]3[/TD]
[TD]45[/TD]
[TD]23[/TD]
[TD]66[/TD]
[/TR]
[TR]
[TD]Mark[/TD]
[TD]2[/TD]
[TD]34[/TD]
[TD]56[/TD]
[TD]77[/TD]
[/TR]
[TR]
[TD]Andrew[/TD]
[TD]9[/TD]
[TD]67[/TD]
[TD]23[/TD]
[TD]88[/TD]
[/TR]
</tbody>[/TABLE]

In my actual excel the list is much larger but I hope you get what I'm trying to achieve.

So in cell G1 for instance I want to show the top 5 numbers from column b starting with the largest and coming down, but I need it so show column A & B. So it would look something like this :-
[TABLE="width: 200"]
<tbody>[TR]
[TD]Andrew[/TD]
[TD]9[/TD]
[/TR]
[TR]
[TD]Sarah[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]Brendan[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]Richard[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]Taylor[/TD]
[TD]3[/TD]
[/TR]
</tbody>[/TABLE]

Then again in Cell I1 I want the top 10% of Column B to be displayed as above. Then in cell K1 I want a formula to list the top 5 based on a number I want to put into the formula.

Hope this makes sense.

Thanks in advance.
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
To get the top 5 you could use the LARGE function

In cell G1 =LARGE(B1:B9,1)
In cell G2 =LARGE(B1:B9,2)

To get the names try

In cell F1 =INDEX($A$1:$E$9,MATCH(H1,$B$1:$B$9),1) and copy down


Obviously change the ranges to suit
 
Last edited:
Upvote 0
To get the top 5 you could use the LARGE function

In cell G1 =LARGE(B1:B9,1)
In cell G2 =LARGE(B1:B9,2)

To get the names try

In cell F1 =INDEX($A$1:$E$9,MATCH(H1,$B$1:$B$9),1) and copy down


Obviously change the ranges to suit

Hi,

Thanks for this. I'm a bit confused as to the reference to cell H1. What does this do as there is no data in H1. Should this be G1 as per the large function ?

Thanks
 
Upvote 0
Another option, that will allow for duplicate values


Book1
ABCDEFG
2Graham112512Andrew9
3Simon1324332Sarah8
4Richard443623Brendan6
5Brendan6123445Stephen5
6Sarah8457733Taylor5
7Stephen5324345
8Taylor5452366
9Mark2345677
10Andrew9672388
Database
Cell Formulas
RangeFormula
F2=INDEX($A$2:$A$10,AGGREGATE(15,6,(ROW($A$2:$A$10)-ROW($A$2)+1)/($B$2:$B$10=G2),COUNTIF(G$2:G2,G2)))
G2=LARGE($B$2:$B$10,ROWS(G$2:G2))
 
Upvote 0
Another option, that will allow for duplicate values

ABCDEFG
GrahamAndrew
SimonSarah
RichardBrendan
BrendanStephen
SarahTaylor
Stephen
Taylor
Mark
Andrew

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]2[/TD]

[TD="align: right"]1[/TD]
[TD="align: right"]12[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]12[/TD]

[TD="align: right"]9[/TD]

[TD="align: center"]3[/TD]

[TD="align: right"]1[/TD]
[TD="align: right"]32[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]332[/TD]

[TD="align: right"]8[/TD]

[TD="align: center"]4[/TD]

[TD="align: right"]4[/TD]
[TD="align: right"]43[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]23[/TD]

[TD="align: right"]6[/TD]

[TD="align: center"]5[/TD]

[TD="align: right"]6[/TD]
[TD="align: right"]12[/TD]
[TD="align: right"]34[/TD]
[TD="align: right"]45[/TD]

[TD="align: right"]5[/TD]

[TD="align: center"]6[/TD]

[TD="align: right"]8[/TD]
[TD="align: right"]45[/TD]
[TD="align: right"]77[/TD]
[TD="align: right"]33[/TD]

[TD="align: right"]5[/TD]

[TD="align: center"]7[/TD]

[TD="align: right"]5[/TD]
[TD="align: right"]32[/TD]
[TD="align: right"]43[/TD]
[TD="align: right"]45[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]8[/TD]

[TD="align: right"]5[/TD]
[TD="align: right"]45[/TD]
[TD="align: right"]23[/TD]
[TD="align: right"]66[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]9[/TD]

[TD="align: right"]2[/TD]
[TD="align: right"]34[/TD]
[TD="align: right"]56[/TD]
[TD="align: right"]77[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]10[/TD]

[TD="align: right"]9[/TD]
[TD="align: right"]67[/TD]
[TD="align: right"]23[/TD]
[TD="align: right"]88[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

</tbody>
Database

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH="width: 10"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]F2[/TH]
[TD="align: left"]=INDEX($A$2:$A$10,AGGREGATE(15,6,(ROW($A$2:$A$10)-ROW($A$2)+1)/($B$2:$B$10=G2),COUNTIF(G$2:G2,G2)))[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]G2[/TH]
[TD="align: left"]=LARGE($B$2:$B$10,ROWS(G$2:G2))[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]

Thanks this worked a treat. Just need to get the top % now and the number above the threshold I set in the formula.

Thanks again.
 
Upvote 0
How do you define the top 10%?
 
Upvote 0
How do you define the top 10%?

Apologies, should have said the top 10% with the highest numbers. Not a good example on what i'm showing but my actual spreadsheet has around 500 lines of data which I want to show the top 10% with the highest numbers.
 
Upvote 0
To do numbers > 5 use


Book1
ABCDEFG
1ABCDE5
2Graham112512Andrew9
3Simon1324332Sarah8
4Richard443623Brendan6
5Brendan6123445
6Sarah8457733
7Stephen5324345
8Taylor3452366
9Mark2345677
10Andrew9672388
Database
Cell Formulas
RangeFormula
F2=IFERROR(INDEX($A$2:$A$10,AGGREGATE(15,6,(ROW($A$2:$A$10)-ROW($A$2)+1)/($B$2:$B$10=G2),COUNTIF(G$2:G2,G2))),"")
G2=IFERROR(AGGREGATE(14,6,$B$2:$B$10/($B$2:$B$10>$G$1),ROWS(G$2:G2)),"")
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top