Adding criteria to dynamic rank formula

droot

New Member
Joined
Oct 18, 2018
Messages
36
Office Version
  1. 365
Platform
  1. Windows
Hi,

I've found a dynamic rank formula on the web that updates the rank as I filter, but I need to add another level, so it's ranking by country. I don't really understand how the formula works, so I'm unable to edit this myself.

This is the formula that I am using - SUM(IF(SUBTOTAL(103,OFFSET($A$2:$A7,ROW($A$2:$A$7)-ROW($A$2),0,1))>0,IF(A2<$A$2:$A$7,1)))+1

ScoresCountryGlobal RankRank by Country
10UK4
23USA3
34UK2
2USA6
65UAE1
3UAE5


Any assistance would be much appreciated.

Thanks
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Hi,

I've found a dynamic rank formula on the web that updates the rank as I filter, but I need to add another level, so it's ranking by country. I don't really understand how the formula works, so I'm unable to edit this myself.

This is the formula that I am using - SUM(IF(SUBTOTAL(103,OFFSET($A$2:$A7,ROW($A$2:$A$7)-ROW($A$2),0,1))>0,IF(A2<$A$2:$A$7,1)))+1

ScoresCountryGlobal RankRank by Country
10UK4
23USA3
34UK2
2USA6
65UAE1
3UAE5


Any assistance would be much appreciated.

Thanks
Book2
ABCD
1ScoresCountryGlobal RankRank by Country
210UK4
323USA3
434UK2
52USA6
665UAE1
73UAE5
Sheet1
Cell Formulas
RangeFormula
C2:C7C2=SUM(IF(SUBTOTAL(103,OFFSET($A$2:$A7,ROW($A$2:$A$7)-ROW($A$2),0,1))>0,IF(A2<$A$2:$A$7,1)))+1
 
Upvote 0
I've tried using an IF and VLOOKUP to look up the country first but that has not given me the desired results (column D).

dynamic_rank_test.xlsx
ABCD
1ScoresCountryGlobal RankRank by Country
210UK49
323USA38
434UK27
52USA611
665UAE16
73UAE510
Sheet1
Cell Formulas
RangeFormula
C2:C7C2=SUM(IF(SUBTOTAL(103,OFFSET($A$2:$A7,ROW($A$2:$A$7)-ROW($A$2),0,1))>0,IF(A2<$A$2:$A$7,1)))+1
D2:D7D2=SUM(IF(VLOOKUP(B2,$B$2:$B$7,1,FALSE)=B2,IF(SUBTOTAL(103,OFFSET($A$2:$A7,ROW($A$2:$A$7)-ROW($A$2),0,1))>0,IF(A2<$A$2:$A$7,1)))+1)
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
How about with a helper column
+Fluff 1.xlsm
ABCDE
1ScoresCountryGlobal RankRank by CountryHelper
210UK421
323USA311
434UK211
52USA621
665UAE111
73UAE521
Main
Cell Formulas
RangeFormula
C2:C7C2=COUNTIFS($A$2:$A$7,">"&A2,$E$2:$E$7,1)+1
D2:D7D2=COUNTIFS($B$2:$B$7,B2,$A$2:$A$7,">"&A2,$E$2:$E$7,1)+1
E2:E7E2=SUBTOTAL(103,A2)
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,264
Messages
6,171,081
Members
452,377
Latest member
bradfordsam

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