Dynamic Rank Formula: No Duplicates or Errors

ReturnAg08

New Member
Joined
Nov 2, 2016
Messages
7
I've seen a number of threads that help with creating rank formulas that solve the duplicates problem by using COUNTIF statements, and others that allow for removal of blanks or #DIV/0! errors, but I'm using a set of data where cells are updating dynamically, and some of them might be numbers at some point, and other times it will show the #N/A error.

Current Formula: RANK(X143,$X$143:$BE$143,1)+COUNTIF($X$143:X143,X143)-1

Columns X through BE have the numbered values, though depending on how the page is updated the columns towards the end might be turned into the #N/A error. I've tried some IFERROR or IF(ISNA()) type things, but either I'm not on the right track or I'm setting it up incorrectly. The values need to be kept as columns, and I can't use VBA here.

Link 1 Source (no blanks): excel - Truly unique ranking (while ignoring empty cells) - Stack Overflow
Link 2 Source (#DIV/0 error): http://www.mrexcel.com/forum/excel-questions/144896-rank-how-exclude-errors.html
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Hi.

Suggestion:

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD="align: center"]Value[/TD]
[TD="align: center"]Rank[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD="align: center"]200[/TD]
[TD="align: center"]2[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD="align: center"]120[/TD]
[TD="align: center"]3[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD="align: center"]1000[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD="align: center"]Text[/TD]
[TD="align: center"]0[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD="align: center"]50[/TD]
[TD="align: center"]4[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD="align: center"]1000[/TD]
[TD="align: center"]1[/TD]
[/TR]
</tbody>[/TABLE]


Array-Formula (Press CTRL-SHIFT-Enter) B2:
{=ISNUMBER(A2)*SUM(IF(IF(ISNUMBER(A$2:A$100)*(COUNTIF(INDIRECT("A1:A"&ROW($A$2:$A$100)),A$2:A$100)=1),A$2:A$100,MIN(A$2:A$100)-1)>A2,1),1)}
 
Upvote 0
Matt,

If I've modified your formula correctly, then it looks like what I've copied below. That works for ranking the first cell, but it's not working when I copy it across to the other cells:

=ISNUMBER(X143)*SUM(IF(IF(ISNUMBER($X$143:$BE$143)*(COUNTIF(INDIRECT("X143:BE"&COLUMN($X$143:$BE$143)),$X143:BE$143)=1),$Y$143:$BE$143,MIN($Y$143:$BE$143)-1)>Y143,1),1)
 
Upvote 0
Matt,

If I've modified your formula correctly, then it looks like what I've copied below. That works for ranking the first cell, but it's not working when I copy it across to the other cells:

=ISNUMBER(X143)*SUM(IF(IF(ISNUMBER($X$143:$BE$143)*(COUNTIF(INDIRECT("X143:BE"&COLUMN($X$143:$BE$143)),$X143:BE$143)=1),$Y$143:$BE$143,MIN($Y$143:$BE$143)-1)>Y143,1),1)

Meant to also say that, yes, I did enter it as an array so it has the curly brackets.
 
Upvote 0

Forum statistics

Threads
1,223,632
Messages
6,173,472
Members
452,516
Latest member
archcalx

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