RANK variable blocks of cells between BLANK cells

BakerBaker

New Member
Joined
Feb 12, 2018
Messages
38
Office Version
  1. 2019
Platform
  1. Windows
I would like to RANK individual blocks of cells within a column which will be a variable number between BLANK cells. In the (simple) example I wish to RANK A1 to A4 and then A6 to A11. A formula in B1 would be copied down to the end of the column, which could be several hundred rows.


A1 22 B1 Formula
A2 46
A3 10
A4 8
A5 BLANK
A6 22
A7 12
A8 43
A9 2
A10 19
A11 18
A12 BLANK

etc
 
With XL2BB, generally better to use Mini Sheet rather than Table Only. That way we can see the column & row references as well as any formulas etc.

What range(s) can we see in that table and what column is the formula in?

Also, what about including the expected results as requested in my previous post?
 
Upvote 0

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
With XL2BB, generally better to use Mini Sheet rather than Table Only. That way we can see the column & row references as well as any formulas etc.

What range(s) can we see in that table and what column is the formula in?

Also, what about including the expected results as requested in my previous post?
Thank you for looking at this. This is a horse racing handicapping workbook. In the example attached, Col. AD (BEST) is simply a sum of the cells across preceding rows. The number of rows in each "block" varies and there can be anything up to 500 rows with an empty row separating each "block". The current formula in Col. AE (RANK) ranks each number within each "block" in Col. AD from highest to lowest. There are often duplicate numbers as shown by the colours. If possible, I would like the current formula to return a UNIQUE ranking.
The current formula in COL. AE is: =IF(AD5="","",RANK(AD5,INDEX(AD$4:AD5,AGGREGATE(14,6,(ROW(AD$4:AD4)-ROW(AD$4)+1)/(AD$4:AD4=""),1)+1):INDEX(AD5:AD$993,MATCH(TRUE,INDEX(AD5:AD$993="",0),0)-1)))

Cell Formulas
RangeFormula
X5,X35:X37,X33,X28:X31,X15:X25,X12:X13,X8:X10X5=IF(D5="","",IF(N5=FALSE,"",IF(S5="NR",0,IF(F5=0,0,IF((U5+V5+W5)>0,0,IF(F5<8,P5,0))))))
AD5:AD37AD5=IF(D5="","",IF(N5=FALSE,"",IF(S5="NR",0,SUM(U5:Y5))))
AE5:AE16AE5=IF(AD5="","",RANK(AD5,INDEX(AD$4:AD5,AGGREGATE(14,6,(ROW(AD$4:AD4)-ROW(AD$4)+1)/(AD$4:AD4=""),1)+1):INDEX(AD5:AD$993,MATCH(TRUE,INDEX(AD5:AD$993="",0),0)-1)))
AF5:AF37AF5=IF(AE5="","",AND(AE5<3,AB5>=4))
AE17:AE37AE17=IF(D17="","",IF(AD17="","",RANK(AD17,INDEX(AD$4:AD17,AGGREGATE(14,6,(ROW(AD$4:AD16)-ROW(AD$4)+1)/(AD$4:AD16=""),1)+1):INDEX(AD17:AD$993,MATCH(TRUE,INDEX(AD17:AD$993="",0),0)-1))))
V36:V37,V30:V34,V16:V28,V9:V14,V5:V7V5=IF(D5="","",IF(N5=FALSE,"",IF(S5="NR",0,IF(H5=0,0,IF(U5>0,0,IF(H5<8,R5,0))))))
W37,W34:W35,W32,W26:W29,W10:W24,W6:W8W6=IF(D6="","",IF(N6=FALSE,"",IF(S6="NR",0,IF(G6=0,0,IF((U6+V6)>0,0,IF(G6<8,Q6,0))))))
Y29:Y37,Y17:Y27,Y11:Y15,Y5:Y9Y5=IF(D5="","",IF(N5=FALSE,"",IF(S5="NR",0,IF(F5=0,0,IF((U5+V5+W5+X5)>0,0,IF(F5<8,O5,0))))))
U5:U37U5=IF(D5="","",IF(N5=FALSE,"",IF(S5="NR",0,IF(I5=0,0,IF(I5<8,S5,0)))))
AA5:AA37AA5=IF(D5="","",IF(N5=FALSE,"",IFERROR(VLOOKUP(D5,Betfair!$A$1:$F$1000,6,FALSE),1000)))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
AF5:AF700Cell Valuecontains "FALSE"textNO
AF5:AF700Cell Valuecontains "TRUE"textNO
AA5:AA700Cell Value=1000textNO
AA5:AA700Cellcontains a blank value textNO
AD3Cell Valuebetween 1 and 3textNO
AB5:AB700,A5:J700,L5:M700,O5:S700,U5:Y700,AD5:AF700Cellcontains a blank value textNO
 
Upvote 0
23 07 23.xlsm
ADAE
1
2
3BESTRANK
4
5761
65610
7753
8725
9725.01
10717
11761.01
12011
13011.01
14708
15579
16753.01
17 
18722
1905
20693
21741
22644
2305.01
24 
25882
26876
27867
28012
29789
30882.01
31882.02
32798
33882.03
34789.01
35911
367611
37 
Rank no ties
Cell Formulas
RangeFormula
AE5:AE37AE5=IF(AD5="","",RANK(AD5,INDEX(AD$4:AD5,AGGREGATE(14,6,(ROW(AD$4:AD4)-ROW(AD$4)+1)/(AD$4:AD4=""),1)+1):INDEX(AD5:AD$993,MATCH(TRUE,INDEX(AD5:AD$993="",0),0)-1))+(COUNTIF(INDEX(AD$4:AD5,AGGREGATE(14,6,(ROW(AD$4:AD4)-ROW(AD$4)+1)/(AD$4:AD4=""),1)+1):AD5,AD5)-1)/100)
 
Upvote 0
23 07 23.xlsm
ADAE
1
2
3BESTRANK
4
5761
65610
7753
8725
9725.01
10717
11761.01
12011
13011.01
14708
15579
16753.01
17 
18722
1905
20693
21741
22644
2305.01
24 
25882
26876
27867
28012
29789
30882.01
31882.02
32798
33882.03
34789.01
35911
367611
37 
Rank no ties
Cell Formulas
RangeFormula
AE5:AE37AE5=IF(AD5="","",RANK(AD5,INDEX(AD$4:AD5,AGGREGATE(14,6,(ROW(AD$4:AD4)-ROW(AD$4)+1)/(AD$4:AD4=""),1)+1):INDEX(AD5:AD$993,MATCH(TRUE,INDEX(AD5:AD$993="",0),0)-1))+(COUNTIF(INDEX(AD$4:AD5,AGGREGATE(14,6,(ROW(AD$4:AD4)-ROW(AD$4)+1)/(AD$4:AD4=""),1)+1):AD5,AD5)-1)/100)
Thank you for taking the time to look at this. I'm able to RANK unique rather than duplicate.
 
Upvote 0
You're welcome. If you wanted whole numbers ..

23 07 23.xlsm
ADAE
1
2
3BESTRANK
4
5761
65610
7753
8725
9726
10717
11762
12011
13012
14708
15579
16754
17 
18722
1905
20693
21741
22644
2306
24 
25882
26876
27867
28012
29789
30883
31884
32798
33885
347810
35911
367611
37 
Rank no ties (2)
Cell Formulas
RangeFormula
AE5:AE37AE5=IF(AD5="","",COUNTIF(INDEX(AD$4:AD5,AGGREGATE(14,6,(ROW(AD$4:AD4)-ROW(AD$4)+1)/(AD$4:AD4=""),1)+1):INDEX(AD5:AD$993,MATCH(TRUE,INDEX(AD5:AD$993="",0),0)-1),">"&AD5) +(COUNTIF(INDEX(AD$4:AD5,AGGREGATE(14,6,(ROW(AD$4:AD4)-ROW(AD$4)+1)/(AD$4:AD4=""),1)+1):AD5,AD5)))
 
Upvote 0
Solution
You're welcome. If you wanted whole numbers ..

23 07 23.xlsm
ADAE
1
2
3BESTRANK
4
5761
65610
7753
8725
9726
10717
11762
12011
13012
14708
15579
16754
17 
18722
1905
20693
21741
22644
2306
24 
25882
26876
27867
28012
29789
30883
31884
32798
33885
347810
35911
367611
37 
Rank no ties (2)
Cell Formulas
RangeFormula
AE5:AE37AE5=IF(AD5="","",COUNTIF(INDEX(AD$4:AD5,AGGREGATE(14,6,(ROW(AD$4:AD4)-ROW(AD$4)+1)/(AD$4:AD4=""),1)+1):INDEX(AD5:AD$993,MATCH(TRUE,INDEX(AD5:AD$993="",0),0)-1),">"&AD5) +(COUNTIF(INDEX(AD$4:AD5,AGGREGATE(14,6,(ROW(AD$4:AD4)-ROW(AD$4)+1)/(AD$4:AD4=""),1)+1):AD5,AD5)))
Even better. Thank you
 
Upvote 0
Even better. Thank you
The marked solution has been changed accordingly. In your future questions, please mark the post as the solution that actually answered your question, instead of your feedback message as it will help future readers. No further action is required for this thread.
 
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