Ranking Array need to move as per the data

sksanjeev786

Well-known Member
Joined
Aug 5, 2020
Messages
994
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi Team,

I am using a Rank formula and i have a lot of data in columns A and B. so I have applied the rank formula in Column C1 :C9 and I just copied that formula in C12 to C20 so the Rank array is still in C1:C9 so I need to drag manually the array from C1: C9 to C12:C20. i have lot of data so need to drag for each Array will take time..

so do we have any option where Array will also come to the new data file instead of doing manual?

book1
ABC
12Ally Bank9
245Bank of America1
317Capital One/Capital One Bank/Capital One 360 (Q117+)5
440Chase2
537Wells Fargo3
63USAA8
719Citibank4
89PNC Bank6
99USBank6
10
11
1217Ally Bank5
1371Bank of America#N/A
1442Capital One/Capital One Bank/Capital One 360 (Q117+)#N/A
1573Chase#N/A
1664Wells Fargo#N/A
1716USAA#N/A
1838Citibank#N/A
1943PNC Bank#N/A
2031USBank#N/A
Sheet1
Cell Formulas
RangeFormula
C1:C9,C12:C20C1=RANK($A1,$A$1:$A$9,0)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C12:C20Cell Valuetop 1 valuestextNO
B12:B20Cell Valuetop 2 valuestextNO
B12:B20Cell Valuetop 1 valuestextNO
B1:B9Cell Valuetop 2 valuestextNO
B1:B9Cell Valuetop 1 valuestextNO
A1:C9Cell Valuetop 1 valuestextNO
A12:B20Cell Valuetop 1 valuestextNO
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Hello, if you are not against a helper column, please test this:

1) helper column to be inserted in D1:

Excel Formula:
=LET(
array,A1:A20,
a,ISNUMBER(array),
b,SCAN(0,a,LAMBDA(a,b,IF(b=TRUE,a+1,0))),
c,SCAN(0,--(b=1),LAMBDA(a,b,a+b)),
IF(a*c=0,"",a*c))

2) rank to be inserted into C1:

Excel Formula:
=LET(
array,A1:A20,
group,D1#,
DROP(REDUCE("",SEQUENCE(ROWS(array)),LAMBDA(a,b,VSTACK(a,IF(INDEX(array,b,0)=0,"",COUNTIFS(group,INDEX(group,b,0),array,">"&INDEX(array,b,0))+1)))),1))
 
Upvote 1
Hello, if you are not against a helper column, please test this:

1) helper column to be inserted in D1:

Excel Formula:
=LET(
array,A1:A20,
a,ISNUMBER(array),
b,SCAN(0,a,LAMBDA(a,b,IF(b=TRUE,a+1,0))),
c,SCAN(0,--(b=1),LAMBDA(a,b,a+b)),
IF(a*c=0,"",a*c))

2) rank to be inserted into C1:

Excel Formula:
=LET(
array,A1:A20,
group,D1#,
DROP(REDUCE("",SEQUENCE(ROWS(array)),LAMBDA(a,b,VSTACK(a,IF(INDEX(array,b,0)=0,"",COUNTIFS(group,INDEX(group,b,0),array,">"&INDEX(array,b,0))+1)))),1))
Hi Sofia,

Getting the error i have checked with 2nd formula

book1
ABCD
12Ally Bank#VALUE!
245Bank of America#VALUE!
317Capital One/Capital One Bank/Capital One 360 (Q117+)#VALUE!
440Chase#VALUE!
537Wells Fargo#VALUE!
63USAA#VALUE!
719Citibank#VALUE!
89PNC Bank#VALUE!
99USBank#VALUE!
10#VALUE!
11#VALUE!
1217Ally Bank#VALUE!
1371Bank of America#VALUE!
1442Capital One/Capital One Bank/Capital One 360 (Q117+)#VALUE!
1573Chase#VALUE!
1664Wells Fargo#VALUE!
1716USAA#VALUE!
1838Citibank#VALUE!
1943PNC Bank#VALUE!
2031USBank#VALUE!
Sheet1
Cell Formulas
RangeFormula
D1:D20D1=LET( array,A1:A20, group,B1, DROP(REDUCE("",SEQUENCE(ROWS(array)),LAMBDA(a,b,VSTACK(a,IF(INDEX(array,b,0)=0,"",COUNTIFS(group,INDEX(group,b,0),array,">"&INDEX(array,b,0))+1)))),1))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C12:C20Cell Valuetop 1 valuestextNO
B12:B20Cell Valuetop 2 valuestextNO
B12:B20Cell Valuetop 1 valuestextNO
B1:B9Cell Valuetop 2 valuestextNO
B1:B9Cell Valuetop 1 valuestextNO
A1:C9Cell Valuetop 1 valuestextNO
A12:B20Cell Valuetop 1 valuestextNO
 
Upvote 0
Hello, you need to first insert the formula ad 1) into D1 and only then this one (ad 2)) into C1 - the latter will not work without the former.
 
Upvote 0
If you wanted to do it without the helper column but are happy to insert a blank row at the top you could try this.

24 08 15.xlsm
ABC
1
22Ally Bank9
345Bank of America1
417Capital One/Capital One Bank/Capital One 360 (Q117+)5
540Chase2
637Wells Fargo3
73USAA8
819Citibank4
99PNC Bank6
109USBank6
11 
12 
1317Ally Bank8
1471Bank of America2
1542Capital One/Capital One Bank/Capital One 360 (Q117+)5
1673Chase1
1764Wells Fargo3
1816USAA9
1938Citibank6
2043PNC Bank4
2131USBank7
Rank
Cell Formulas
RangeFormula
C2:C21C2=IF(A2="","",RANK(A2,INDEX(A$1:A2,AGGREGATE(14,6,(ROW(A$1:A1)-ROW(A$1)+1)/(A$1:A1=""),1)+1):INDEX(A2:A$1000,MATCH(TRUE,INDEX(A2:A$1000="",0),0)-1)))
 
Upvote 1
If you wanted to do it without the helper column but are happy to insert a blank row at the top you could try this.

24 08 15.xlsm
ABC
1
22Ally Bank9
345Bank of America1
417Capital One/Capital One Bank/Capital One 360 (Q117+)5
540Chase2
637Wells Fargo3
73USAA8
819Citibank4
99PNC Bank6
109USBank6
11 
12 
1317Ally Bank8
1471Bank of America2
1542Capital One/Capital One Bank/Capital One 360 (Q117+)5
1673Chase1
1764Wells Fargo3
1816USAA9
1938Citibank6
2043PNC Bank4
2131USBank7
Rank
Cell Formulas
RangeFormula
C2:C21C2=IF(A2="","",RANK(A2,INDEX(A$1:A2,AGGREGATE(14,6,(ROW(A$1:A1)-ROW(A$1)+1)/(A$1:A1=""),1)+1):INDEX(A2:A$1000,MATCH(TRUE,INDEX(A2:A$1000="",0),0)-1)))

Thank you So much Peter for help me with this :)

Can I get an automatic ranking based on the column A and G so that I can output on I and J column along with above conditions

book2
ABCDEFGHIJ
2Capital One2221.22121.42221.2Capital One21.2
3Ally8.48.48.58.48.48.4Chase17.7
4B of A15.516.214.714.915.516.2B of A16.2
5Chase17.717.718.618.617.717.7Wells Fargo12.5
6Wells Fargo12.412.511.712.212.412.5Citibank12.2
7USAA109.59.19.9109.5USAA9.5
8Citibank12.212.211.712.112.212.2Ally8.4
9PNC6.67.17.16.76.67.1USBank7.4
10USBank7.77.47.88.17.77.4PNC7.1
Sheet2
 
Upvote 0
Is this a separate question with just a single group of data or are there really several groups with space between each group like earlier in the thread?
If several groups please give sample data and expected results for at least two groups.
 
Upvote 0
Is this a separate question with just a single group of data or are there really several groups with space between each group like earlier in the thread?
If several groups please give sample data and expected results for at least two groups.

Hi Peter,

It is the same questions related to the above I need ranking from A and G columns (output is I and J column ) and the array is now is rows 2- 10 and same data I have from 13-21 and 23-31.

so instead of changing array can I get in one go.... with out changing the arrow....

Regards
Sanjeev
 
Upvote 0
  1. Will this sheet still have the ranking as per the original question?
  2. Does this need to be without a helper column? If so, the formulas will be much more complicated.
 
Upvote 0

Forum statistics

Threads
1,223,884
Messages
6,175,174
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