Rankif formula for multiple columns of data

Obewan

Board Regular
Joined
Aug 25, 2021
Messages
68
Office Version
  1. 365
Platform
  1. Windows
I have the following:
AY = a list of codes (i.e. unique identifiers)
BM:BR - columns of data

In BS I have a formula as follows which I can copy down that column (starts on row 7):
=COUNTIFS($AY$7:$AY$100000,$AY7,$BN$7:$BN$100000,">"&BN7)+1

This works and ranks all numbers in column BN according to correpsonding code in AY

What I want to do is extend this formula so it covers all data in columns BN:BR for the code - I changed the formula to
=COUNTIFS($AY$7:$AY$100000,$AY7,$BN$7:$BR$100000,">"&BN7)+1

but just get an error message #VALUE!

Any suggestions?

Thanks in advance

Seamus
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Hi Seamus,

Please find the logic.

Book1
ABCDEF
1NameValue 1Value 2Value 3Value 4Rank
2A1989925486924160921
3A163687110260231092
4A4539131181285073439
5B9275458319218170056
6B75526088264667017
7B534212409139311398810
8C16849156611534249951
9C146229506148584844
10C33031085610270827611
11D166846113779126723
Sheet1
Cell Formulas
RangeFormula
F2:F11F2=1+SUMPRODUCT(($A$2:$A$11=A2)*($B$2:$E$11>B2))
Named Ranges
NameRefers ToCells
_FilterDatabase=Sheet1!$A$3:$F$13F2:F11
 
Upvote 0
Hi Seamus,

Please find the logic.

Book1
ABCDEF
1NameValue 1Value 2Value 3Value 4Rank
2A1989925486924160921
3A163687110260231092
4A4539131181285073439
5B9275458319218170056
6B75526088264667017
7B534212409139311398810
8C16849156611534249951
9C146229506148584844
10C33031085610270827611
11D166846113779126723
Sheet1
Cell Formulas
RangeFormula
F2:F11F2=1+SUMPRODUCT(($A$2:$A$11=A2)*($B$2:$E$11>B2))
Named Ranges
NameRefers ToCells
_FilterDatabase=Sheet1!$A$3:$F$13F2:F11
That works great with the exception it's picking up blank cells and ranking them all as 1. If I could exclude blanks cells would be perfect?
 
Upvote 0
That works great with the exception it's picking up blank cells and ranking them all as 1. If I could exclude blanks cells would be perfect?
Can you share a sample of lines so that I can check the logic and share it with you?
 
Upvote 0
Can you share a sample of lines so that I can check the logic and share it with you?
Book2
ABCDEFGHIJK
1Code11111Rank1Rank2Rank3Rank4Rank5
244216Ascot114.027.528.06.59.02718163029
344216Ascot132.033.027.513.031.51110182812
444216Ascot129.530.023.523.0141325261
544216Ascot127.025.528.020211611
644216Ascot129.025.524.515212311
744216Ascot124.5231111
844216Ascot228.533.024.511.033.52814414911
944216Ascot222.534.527.034.543.54363562
1044216Ascot228.511.021.531.035.0284945195
1144216Ascot219.527.031.033.524.04735191142
1244216Ascot227.526.029.026.021.53238273845
1344216Ascot227.031.036.530.528.5351932328
1444216Ascot234.531.030.533.025.5619231440
1544216Ascot232.029.534.536.045.51826641
1644216Ascot234.030.532.514.027.51023164832
1744216Ascot233.532.522.528.527.51116432832
1844216Ascot316.510.522.518.018.53641273532
1944216Ascot314.021.55.59.518.54029444232
2044216Ascot35.023.518.516.07.54526323843
2144216Ascot319.528.532.031171411
2244216Ascot329.528.028.029.524.51519191524
2344216Ascot328.527.020.017223011
2444216Ascot30.00.00.00.00.04646464646
2544216Ascot328.027.024.519222411
2644216Ascot322.016.52836111
2744216Ascot314.5391111
2844216Ascot30.00.00.00.00.04646464646
2944216Ascot30.00.00.00.00.04646464646
Sheet1
Cell Formulas
RangeFormula
G2:K29G2=1+SUMPRODUCT(($A$2:$A$99995=$A2)*($B$2:$F$99995>B2))
 
Upvote 0
Book2
ABCDEFGHIJK
1Code11111Rank1Rank2Rank3Rank4Rank5
244216Ascot114.027.528.06.59.02718163029
344216Ascot132.033.027.513.031.51110182812
444216Ascot129.530.023.523.0141325261
544216Ascot127.025.528.020211611
644216Ascot129.025.524.515212311
744216Ascot124.5231111
844216Ascot228.533.024.511.033.52814414911
944216Ascot222.534.527.034.543.54363562
1044216Ascot228.511.021.531.035.0284945195
1144216Ascot219.527.031.033.524.04735191142
1244216Ascot227.526.029.026.021.53238273845
1344216Ascot227.031.036.530.528.5351932328
1444216Ascot234.531.030.533.025.5619231440
1544216Ascot232.029.534.536.045.51826641
1644216Ascot234.030.532.514.027.51023164832
1744216Ascot233.532.522.528.527.51116432832
1844216Ascot316.510.522.518.018.53641273532
1944216Ascot314.021.55.59.518.54029444232
2044216Ascot35.023.518.516.07.54526323843
2144216Ascot319.528.532.031171411
2244216Ascot329.528.028.029.524.51519191524
2344216Ascot328.527.020.017223011
2444216Ascot30.00.00.00.00.04646464646
2544216Ascot328.027.024.519222411
2644216Ascot322.016.52836111
2744216Ascot314.5391111
2844216Ascot30.00.00.00.00.04646464646
2944216Ascot30.00.00.00.00.04646464646
Sheet1
Cell Formulas
RangeFormula
G2:K29G2=1+SUMPRODUCT(($A$2:$A$99995=$A2)*($B$2:$F$99995>B2))
Book1
ABCDEFGHIJK
1Code11111Rank1Rank2Rank3Rank4Rank5
244216Ascot11428286.5918972120
344216Ascot13233281332219193
444216Ascot130302423541617 
544216Ascot127262811127  
644216Ascot129262561214  
744216Ascot12514    
844216Ascot229332511342814414911
944216Ascot223352735444363562
Sheet4
Cell Formulas
RangeFormula
G2:K9G2=IF(B2="","",1+SUMPRODUCT(($A$2:$A$99995=$A2)*($B$2:$F$99995>B2)))
 
Upvote 0
Book1
ABCDEFGHIJK
1Code11111Rank1Rank2Rank3Rank4Rank5
244216Ascot11428286.5918972120
344216Ascot13233281332219193
444216Ascot130302423541617 
544216Ascot127262811127  
644216Ascot129262561214  
744216Ascot12514    
844216Ascot229332511342814414911
944216Ascot223352735444363562
Sheet4
Cell Formulas
RangeFormula
G2:K9G2=IF(B2="","",1+SUMPRODUCT(($A$2:$A$99995=$A2)*($B$2:$F$99995>B2)))
Still not working for me?
Book2
ABCDEFGHIJK
1Code11111Rank1Rank2Rank3Rank4Rank5
244216Ascot114.027.528.06.59.02718163029
344216Ascot132.033.027.513.031.51110182812
444216Ascot129.530.023.523.014132526 
544216Ascot127.025.528.0202116  
644216Ascot129.025.524.5152123  
744216Ascot124.523    
844216Ascot228.533.024.511.033.52814414911
944216Ascot222.534.527.034.543.54363562
1044216Ascot228.511.021.531.035.0284945195
1144216Ascot219.527.031.033.524.04735191142
1244216Ascot227.526.029.026.021.53238273845
1344216Ascot227.031.036.530.528.5351932328
1444216Ascot234.531.030.533.025.5619231440
1544216Ascot232.029.534.536.045.51826641
1644216Ascot234.030.532.514.027.51023164832
1744216Ascot233.532.522.528.527.51116432832
1844216Ascot316.510.522.518.018.53641273532
1944216Ascot314.021.55.59.518.54029444232
2044216Ascot35.023.518.516.07.54526323843
2144216Ascot319.528.532.0311714  
2244216Ascot329.528.028.029.524.51519191524
2344216Ascot328.527.020.0172230  
2444216Ascot30.00.00.00.00.04646464646
2544216Ascot328.027.024.5192224  
2644216Ascot322.016.52836   
2744216Ascot314.539    
2844216Ascot30.00.00.00.00.04646464646
2944216Ascot30.00.00.00.00.04646464646
Sheet1
Cell Formulas
RangeFormula
G2:K29G2=IF(B2="","",1+SUMPRODUCT(($A$2:$A$99995=$A2)*($B$2:$F$99995>B2)))
 
Upvote 0
Still not working for me?
Book2
ABCDEFGHIJK
1Code11111Rank1Rank2Rank3Rank4Rank5
244216Ascot114.027.528.06.59.02718163029
344216Ascot132.033.027.513.031.51110182812
444216Ascot129.530.023.523.014132526 
544216Ascot127.025.528.0202116  
644216Ascot129.025.524.5152123  
744216Ascot124.523    
844216Ascot228.533.024.511.033.52814414911
944216Ascot222.534.527.034.543.54363562
1044216Ascot228.511.021.531.035.0284945195
1144216Ascot219.527.031.033.524.04735191142
1244216Ascot227.526.029.026.021.53238273845
1344216Ascot227.031.036.530.528.5351932328
1444216Ascot234.531.030.533.025.5619231440
1544216Ascot232.029.534.536.045.51826641
1644216Ascot234.030.532.514.027.51023164832
1744216Ascot233.532.522.528.527.51116432832
1844216Ascot316.510.522.518.018.53641273532
1944216Ascot314.021.55.59.518.54029444232
2044216Ascot35.023.518.516.07.54526323843
2144216Ascot319.528.532.0311714  
2244216Ascot329.528.028.029.524.51519191524
2344216Ascot328.527.020.0172230  
2444216Ascot30.00.00.00.00.04646464646
2544216Ascot328.027.024.5192224  
2644216Ascot322.016.52836   
2744216Ascot314.539    
2844216Ascot30.00.00.00.00.04646464646
2944216Ascot30.00.00.00.00.04646464646
Sheet1
Cell Formulas
RangeFormula
G2:K29G2=IF(B2="","",1+SUMPRODUCT(($A$2:$A$99995=$A2)*($B$2:$F$99995>B2)))
Does it need to exclude zero "0" also in ranking

Book1
ABCDEFGHIJK
1Code11111Rank1Rank2Rank3Rank4Rank5
244216Ascot11428286.5918972120
344216Ascot13233281332219193
444216Ascot130302423541617 
544216Ascot127262811127  
644216Ascot129262561214  
744216Ascot12514    
844216Ascot229332511342814414911
944216Ascot223352735444363562
1044216Ascot22911223135284945195
1144216Ascot220273134244735191142
1244216Ascot228262926223238273845
1344216Ascot22731373129351932328
1444216Ascot23531313326619231440
1544216Ascot232303536461826641
1644216Ascot234313314281023164832
1744216Ascot234332329281116432832
1844216Ascot317112318192328142219
1944216Ascot314225.59.5192716312919
2044216Ascot352419167.53213192530
2144216Ascot32029321841  
2244216Ascot33028283025266211
2344216Ascot32927204917  
2444216Ascot300000     
2544216Ascot32827256911  
2644216Ascot322171523   
2744216Ascot31526    
2844216Ascot300000     
2944216Ascot300000     
Sheet4
Cell Formulas
RangeFormula
G2:K29G2=IF(OR(B2="",B2=0),"",1+SUMPRODUCT(($A$2:$A$99995=$A2)*($B$2:$F$99995>B2)))
 
Upvote 0
Does it need to exclude zero "0" also in ranking

Book1
ABCDEFGHIJK
1Code11111Rank1Rank2Rank3Rank4Rank5
244216Ascot11428286.5918972120
344216Ascot13233281332219193
444216Ascot130302423541617 
544216Ascot127262811127  
644216Ascot129262561214  
744216Ascot12514    
844216Ascot229332511342814414911
944216Ascot223352735444363562
1044216Ascot22911223135284945195
1144216Ascot220273134244735191142
1244216Ascot228262926223238273845
1344216Ascot22731373129351932328
1444216Ascot23531313326619231440
1544216Ascot232303536461826641
1644216Ascot234313314281023164832
1744216Ascot234332329281116432832
1844216Ascot317112318192328142219
1944216Ascot314225.59.5192716312919
2044216Ascot352419167.53213192530
2144216Ascot32029321841  
2244216Ascot33028283025266211
2344216Ascot32927204917  
2444216Ascot300000     
2544216Ascot32827256911  
2644216Ascot322171523   
2744216Ascot31526    
2844216Ascot300000     
2944216Ascot300000     
Sheet4
Cell Formulas
RangeFormula
G2:K29G2=IF(OR(B2="",B2=0),"",1+SUMPRODUCT(($A$2:$A$99995=$A2)*($B$2:$F$99995>B2)))
You are getting the right answers but I am not - it still appears to be ranking all the blank cells as 1 then the numbers tart getting ranked thereafter - this is weird as it's working for you?
 
Upvote 0
You are getting the right answers but I am not - it still appears to be ranking all the blank cells as 1 then the numbers tart getting ranked thereafter - this is weird as it's working for you?
Is there a way it could count all the blank cells and then we deduct them from the ranks?
 
Upvote 0

Forum statistics

Threads
1,215,438
Messages
6,124,873
Members
449,192
Latest member
MoonDancer

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