Hstack and Rank.. incompaible??

MartyCollins

New Member
Joined
Jan 21, 2022
Messages
38
Office Version
  1. 365
Platform
  1. Windows
Hi there,
So i have a couple of spilled arrays side by side that have been working fine for the last 2 years or so.
So to take advantage of Hstack i am trying to put them all into one formula.
They all stack together fine except the final column which is a spilled rank of the adjacent column.

Its sensitive data so here is a really simple Example to exlpain:
On the left.. 2 spilled arrays, on the right Hstack brininging the 2 arrays together (My real data has several complex arrays and they stack together fine..except for the rank!)
Thanks,
Martin.

Lamdbas.xlsx
RSTUV
4Individual Spilled ArraysHstack
5RandomRankRandomRank
6411194#VALUE!
71161#VALUE!
849135#VALUE!
9891943#VALUE!
10861864#VALUE!
11681563#VALUE!
121053#VALUE!
13381045#VALUE!
1428730#VALUE!
156372#VALUE!
167439#VALUE!
1731945#VALUE!
1830871#VALUE!
1973161#VALUE!
205268#VALUE!
21461220#VALUE!
22902044#VALUE!
23491385#VALUE!
2425679#VALUE!
25771717#VALUE!
Goodly_matchTax
Cell Formulas
RangeFormula
R6:R25R6=RANDARRAY(20,1,1,100,TRUE)
S6:S25S6=RANK.EQ(R6#,R6#,1)
U6:V25U6=LET( Randoms, RANDARRAY(20,1,1,100,TRUE), Priority, RANK.EQ(Randoms,Randoms,1), Hstack(Randoms,Priority) )
Dynamic array formulas.
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
The weird thing is this works...

=LET( Randoms, R6#,
Priority, RANK.EQ(Randoms,Randoms,1),
Hstack(Randoms,Priority) )
 
Upvote 0
Rank only works on a range, not an array which is why your original formula does not work.
How about
Excel Formula:
=LET(Randoms,RANDARRAY(20,1,1,100,TRUE),Priority,MATCH(Randoms,SORT(Randoms),0),HSTACK(Randoms,Priority))
 
Upvote 0
Solution
Rank only works on a range, not an array
Practically, that seems to be the case, but it isn't what the Help is saying is it?

1662636156418.png
 
Upvote 0
What I originally meant (but didn't say very well) is that the 1st argument has to be a range.
That said I subsequently tried to use BYROW to show another option & found it didn't work with an array as the 2nd argument either, so the help is definitely missleading (unless I'm doing something wrong).
 
Upvote 0
And even that is misleading as you can use an array for the criteria. :(
 
Upvote 0
Thanks Fluff/Peter- ill have to try get my head around that as it accepts a spilled array as an input... anyway that solution works.. i just have to try shoehorn it into my own work!!
 
Upvote 0
ill have to try get my head around that as it accepts a spilled array as an input
Well, that is a range. In your working example, R6# is the worksheet range of cells beginning at cell R6 and ending at the last spilled cell.
 
Upvote 0

Forum statistics

Threads
1,215,310
Messages
6,124,181
Members
449,147
Latest member
sweetkt327

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