Rank / Index / Match

Thoron6

New Member
Joined
Oct 27, 2015
Messages
27
Morning all,

I have a long list of the example data below and would like to bring back the top 5 site names (based on highest number in "kWh" descending) where the manager is "Graham" and open / Closed is "Open".

Any help would be appreciated:

NameManagerOpen / ClosedkWh
Site 1LeeOpen2,746
Site 2GrahamOpen2,458
Site 3GrahamClosed1,643
Site 4GrahamClosed4,312
Site 5GrahamOpen3,408
Site 6GrahamOpen580
Site 7LeeOpen1,601
Site 8LeeOpen890
Site 9LeeOpen3,613
Site 10LeeClosed4,664
Site 11BrianOpen4,255
Site 12PaulaOpen525
Site 13BrianOpen3,529
Site 14AdrianOpen3,986
Site 15AdrianOpen2,335
Site 16GrahamOpen914
Site 17AdrianOpen1,541
Site 18PhilOpen4,026
Site 19PhilOpen3,660
Site 20PhilOpen3,628
Site 21PhilClosed1,506
Site 22PhilOpen1,211

<tbody>
</tbody>
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

Book1
ABCDGH
1NameManagerOpen / ClosedkWhgraham
2Site 1LeeOpen2,746open
3Site 2GrahamOpen2,4585
4Site 3GrahamClosed1,6434
5Site 4GrahamClosed4,312Top N kWhTop N Sites
6Site 5GrahamOpen3,4083408Site 5
7Site 6GrahamOpen5802458Site 2
8Site 7LeeOpen1,601914Site 16
9Site 8LeeOpen890580Site 6
10Site 9LeeOpen3,613
11Site 10LeeClosed4,664
12Site 11BrianOpen4,255
13Site 12PaulaOpen525
14Site 13BrianOpen3,529
15Site 14AdrianOpen3,986
16Site 15AdrianOpen2,335
17Site 16GrahamOpen914
18Site 17AdrianOpen1,541
19Site 18PhilOpen4,026
20Site 19PhilOpen3,660
21Site 20PhilOpen3,628
22Site 21PhilClosed1,506
Sheet1 (2)


G1: 5 (desired Top N)

In G2 control+shift+enter, not just enter:

=COUNTIFS(B2:B23,G1,C2:C23,G2,D2:D23,">="&LARGE(IF(B2:B23=G1,IF(C2:C23=G2,D2:D23)),MIN(G3,COUNTIFS(B2:B23,G1,C2:C23,G2))))

In G6 control+shift+enter, not just enter, and copy down:

=IF(ROWS($G$6:G6)>$K$1,"",LARGE(IF($B$2:$B$23=$G$1,IF($C$2:$C$23=$G$2,$D$2:$D$23)),ROWS($G$6:G6)))

In H6 control+shift+enter, not just enter, and copy down:

=IF($G6="","",INDEX($A$2:$A$23,SMALL(IF($B$2:$B$23=$G$1,IF($C$2:$C$23=$G$2,IF($D$2:$D$23=$G6,ROW($A$2:$A$23)-ROW($A$2)+1))),COUNTIFS($G$6:G6,G6))))
 
Upvote 0

Forum statistics

Threads
1,215,480
Messages
6,125,048
Members
449,206
Latest member
Healthydogs

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