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
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Hi,

I'm not sure i understood your problem. (what do you mean by "rank")

Try this in B1 & copy down :

=COUNTBLANK($A$1:$A1)
 
Last edited:
Upvote 0
RANK as in sort to order.
A B
1 22 =RANK(A1,$A$1:$A$4,0) (Result is 2)
2 46 =RANK(A2,$A$1:$A$4,0) (Result is 1)
3 10 =RANK(A3,$A$1:$A$4,0) (Result is 3)
4 8 =RANK(A4,$A$1:$A$4,0) (Result is 4)
5 BLANK
6 22 =RANK(A6,$A$6:$A$11,0) (Result is 2)
7 12 =RANK(A7,$A$6:$A$11,0) (Result is 5)
8 43 =RANK(A8,$A$6:$A$11,0) (Result is 1)
9 2 =RANK(A9,$A$6:$A$11,0) (Result is 6)
10 19 =RANK(A10,$A$6:$A$11,0) (Result is 3)
11 18 =RANK(A11,$A$6:$A$11,0) (Result is 4)
12 BLANK

I do not want to have to physically change the formula after each blank row. I have seen a formula online that can be copied down the column that will do this - unfortunately cannot find it again.
 
Upvote 0
Leave a blank cell above the first value, then use this formula, copied down.

Excel Workbook
AB
1
2222
3461
4103
584
6
7222
8125
9431
1026
11193
12184
13
1452
1561
16
Rank
 
Upvote 0
Absolutely excellent! Thanks for the time spent looking into this. Will save me a LOT of time
 
Upvote 0
Peter, that's brilliant It's gone into my formulas folder.

I assume its the latter part of the formula that determines the range to work on.

I tried it with min and max it works (and |I know you didn't design it for this so it's not failing), in these instances
it puts the min or max in every cell in the group, is there a way to avoid this or would it be a completely different formula.

If completely different, don't worry, it's just a learning exercise.
 
Upvote 0
.. it puts the min or max in every cell in the group, is there a way to avoid this ...
There would be, but if you don't want the min (or max) in every cell in the group, you would need to specify where do you want it?
 
Upvote 0

Forum statistics

Threads
1,214,834
Messages
6,121,876
Members
449,056
Latest member
ruhulaminappu

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