Sectional Ranking, is it possible

Davebro

Board Regular
Joined
Feb 22, 2018
Messages
135
Office Version
  1. 365
  2. 2021
  3. 2016
Platform
  1. Windows
Is it possible to copy the ranking function down a column ranking each section separately?


Book1
AB
1183
2174
3261
426
5212
6165
7
8
9
10
11
1212
1339
1434
152
162
1723
18
19
20
21
22
234
2434
2516
2624
2712
2811
29
30
31
32
33
3417
3530
362
3720
3818
3914
Sheet1
Cell Formulas
RangeFormula
B1:B6B1=RANK(A1,$A$1:$A$6)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A33:A42Expression=$C35textNO
A22:A31Expression=$C24textNO
A1:A9Expression=$C3textNO
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
As long as it follows the same pattern (6 data rows every 11 rows), I would use VBA to set up all those formulas at once like this:
VBA Code:
Sub MyRankingMacro()

    Dim r As Long
    Dim rng As String
    
    Application.ScreenUpdating = False
    
'   Set initial row value
    r = 1
    
'   Loop through cells in column A
    Do
'       If column A is blank, exit loo
        If Cells(r, "A") = "" Then Exit Do
'       Build range string
        rng = "$A$" & r & ":$A$" & r + 5
'       Populate formula in column B
        Range("B" & r & ":B" & r + 5).Formula = "=RANK(A" & r & "," & rng & ")"
'       Increment row counter by 11
        r = r + 11
    Loop

    Application.ScreenUpdating = True
    
End Sub
 
Upvote 1
Solution
Wow, that's just what I was after, thanks so much for your time and expertise.
 
Upvote 0
You are welcome.
Glad I was able to help!
:)
 
Upvote 1

Forum statistics

Threads
1,223,911
Messages
6,175,327
Members
452,635
Latest member
laura12345

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