Rank Function Only on Visible Cells

cdubs34

New Member
Joined
Jul 26, 2011
Messages
34
Basically I want to use the rank function (i.e. 1,2,3,4) for only visible cells. So I want to avoid getting a rank of 1 2 4 where the third value is a hidden cell. Thank you in advance for your help.
 
Last edited:

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
To rank from highest to lowest visible cells that are the result of either an AutoFilter or manually hidden rows, assuming that A2:A100 contains the data, try...

B2, confirmed with CONTROL+SHIFT+ENTER, and copy down:

=SUM(IF(SUBTOTAL(103,OFFSET($A$2:$A$100,ROW($A$2:$A$100)-ROW($A$2),0,1))>0,IF(A2<$A$2:$A$100,1)))+1

Adjust the ranges accordingly. To rank from lowest to highest, replace...

A2<$A$2:$A$100

with

A2>$A$2:$A$100
 
Last edited:
Upvote 0
Thank you for the response Domenic. I have mirrored your formula above for my data set, however when I drag the formula down from the first cell I just get 1 for each "ranking". Please let me know if you know why this is. Thanks.
 
Upvote 0
Could I send my excel spreadsheet to someone as it would be easier to visualize the issue that way? Thanks
 
Upvote 0
....when I drag the formula down from the first cell I just get 1 for each "ranking".

That sounds like you haven't used CTRL+SHIFT+ENTER

Put the formula in the first cell, press F2 to select the formula and then hold down CTRL and SHIFT keys and press ENTER. Curly braces like { and } should appear around the formula in the formula bar. Now copy down

An alternative would be to use SUMPRODUCT to get a "regular" formula, i.e.

=SUMPRODUCT(SUBTOTAL(103,OFFSET($A$2:$A$100,ROW($A$2:$A$100)-ROW($A$2),0,1)),(A2<$A$2:$A$100)+0)+1
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,884
Messages
6,175,173
Members
452,615
Latest member
bogeys2birdies

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