Rank formula with 2 columns ignoring zero values

gaftalik

Well-known Member
Joined
Feb 6, 2003
Messages
521
Office Version
  1. 2016
Platform
  1. Windows
Hi everyone,

In column A1: A25 i have some cells with values and others are blank or equal to 0
In column C1:C20 i have the same thing
How to use a Rank formula in cells B1:B25 and D1:D20 to rank in ascending order using as criteria the data from column A1:A25 and C1:C20?

Thank you for your support !
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Also can you post some sample data, along with expected results.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
Thank you Fluff for your guidance!

Here is my new thread :

I need in B2: B21 and D2:D21 a rank formula to return the rank of A2:A21 and C2:C21 ignoring zero value cells (blank cells) to return blank when filling down the formula.
Results should be as in column B and D in red color and in descending order.

Thank you much !

Rank multiple crieria ignoring zero values.xlsx
ABCDEFGHI
1PercentageRankPercentageRank
247.7%20 =if(A2>0,rank(A2,$A$2:$A$21,$C$2:$C$21,1),"") ???
3
4
528.5%6
628.1%327.4%2
7
833.7%1431.7%11
933.3%13
1028.2%4
11
1228.2%431.7%12
13
1427.3%129.1%8
1539.3%1937.3%19
1631.4%10
1734.6%15
18
19
2028.9%730.7%9
2136.8%1736.4%16
22
Sheet1
 
Upvote 0
Allowing for the error in D15 of your example, this looks correct.
Book1
ABCD
1PercentageRankPercentageRank
247.71%20 
3  
4  
5 28.53%6
628.08%327.37%2
7  
833.69%1431.72%11
9 33.25%13
1028.17%4 
11  
1228.17%431.74%12
13  
1427.28%129.06%8
1539.29%1937.29%18
16 31.38%10
17 34.64%15
18  
19  
2028.95%730.74%9
2136.85%1736.37%16
Sheet2
Cell Formulas
RangeFormula
B2:B21,D2:D21B2=IF(A2="","",COUNTIF($A$2:$A$21,"<"&A2)+COUNTIF($C$2:$C$21,"<"&A2)+1)
 
Upvote 0
Solution
Yeah thank you that worked great! but i dont know why on my sheet i inserted 2 more rows above and had to delete the+1 from the end of formula and worked perfectly.
I never knew i dont need the Rank formula.

Many thanks Jason!
 
Upvote 0
i dont know why on my sheet i inserted 2 more rows above and had to delete the+1 from the end of formula
Not sure exactly what has happened there but you shouldn't need to change that. I can insert 2 rows above, or between the existing and it still works fine. If it is behaving differently for you then there could be something else causing the problem which, if not found might cause further issues that could go unnoticed.
 
Upvote 0
Please check the difference on different columns and see the correct answer in AV4 is by deleting the +1 !?
Why that is happening ?

Rank multiple crieria ignoring zero values.xlsx
ATAUAVAWAXAY
1
2
3
447.71%2120 
5  
6  
7 28.53%7
828.08%427.37%3
9  
1033.69%1531.72%12
11 33.25%14
1228.17%5 
13  
1428.17%531.74%13
15  
1627.28%229.06%9
1739.29%2037.29%19
18 31.38%11
19 34.64%16
20  
210.00%1 
2228.95%830.74%10
2336.85%1836.37%17
24
25
Sheet2
Cell Formulas
RangeFormula
AV4AV4=IF(AT4="","",COUNTIF($AT$4:$AT$23,"<"&AT4)+COUNTIF($AW$4:$AW$23,"<"&AT4))
AX4:AX23,AU4:AU23AU4=IF(AT4="","",COUNTIF($AT$4:$AT$23,"<"&AT4)+COUNTIF($AW$4:$AW$23,"<"&AT4)+1)
 
Upvote 0
AU4 is correct, not AV4. Check your results again very carefully.

The data set is exactly the same as the original with 1 exception, it contains an extra value of 0.00% in AT21 which now occupies the position of rank 1 meaning that everything else moved up 1 position.
 
Upvote 0
Sorry it was my mistake i had row 21 hidden on my sheet and in the mini sheet it appeared, i didnt know, once i deleted the formula from that cell and added +1 on your formula it worked well.
Thank you much !
 
Upvote 0
Do you need it to ignore hidden hows if there are any?

It will need a different formula but it should be possible.
 
Upvote 0

Forum statistics

Threads
1,215,051
Messages
6,122,871
Members
449,097
Latest member
dbomb1414

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