Skip to main content

How to rank only visible cells in Excel?

Author: Sun Last Modified: 2020-09-08

In general, all the cells including both filtered values and unfiltered values will be ranked by the Rank function. However, in some cases, you just want to rank only the filtered values which means to rank only visible cells in the sheet as below screenshot shown in Excel.
doc rank only visible cells 1

Rank only visible/filtered cells in Excel


arrow blue right bubble Rank only visible/filtered cells in Excel

To rank only visible cells, you can apply a formula.

Select a cell that you want to place the ranking result, type this formula =SUM(IF(SUBTOTAL(103,OFFSET($A$2:$A$8,ROW($A$2:$A$8)-ROW($A$2),0,1))>0,IF(A2<$A$2:$A$8,1)))+1, press Shift + Ctrl + Enter keys, then drag auto fill handle down to fill this formula to the cells.

In the formula, A2 are the first cell you want to rank, A2:A8 is the range you want to rank.
doc rank only visible cells 2

Then when you filter data, the visible values will be automatically reranked.
doc rank only visible cells 3

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...

Description


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
Comments (5)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
I can't count, obviously. The rank would be four in a group of four. Duh.
This comment was minimized by the moderator on the site
This seems to use only unique values for the ranking, ignoring values that are duplicated. In a group of four, if there are four values of 1 and we are ranking the value 2, using this formula the rank would be two, not five. Is that correct?
This comment was minimized by the moderator on the site
Hi, Alan Brown, for solving your problem, you need two formulas.
for example, G1:G7 is the column range you want to rank, in H1, type below formula:
=SUMPRODUCT((G1<G$1:G$7)/COUNTIF(G$1:G$7,G$1:G$7))+1
then drag auto fill handle down to H7
in next cell, I1, use below formula:
=RANK($H1,$H$1:$H$7)
press Enter key and drag auto fill handle down to I7, then the rank is finished.
Please let me know if it works, thanks.
This comment was minimized by the moderator on the site
The above Rank only visible cells tip is awesome, Thank you, but CHALLENGE... How do you add excluding zeros to the array formula. I can't seem to get the syntax right to do both Visible and Non-Zero, in one array formula.
This comment was minimized by the moderator on the site
You can use an IF function in a "helper" column to regard it as a very small value e.g. 1E-62 [i.e. enter this function in Column D >> Cell D2 =IF(A2=0,1E-62,A2)]
There are no comments posted here yet
Leave your comments
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations