If an Excel function requires a ref and will not take an array, is there a way to convert an array to a ref?

TomCon

Active Member
Joined
Mar 31, 2011
Messages
385
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
For instance, i can use this array formula with the SUM() function.
Excel Formula:
=SUM(IF(N2:N1037="Relief",L2:L1037))

But, if i want to use the RANK() function, i analogously try:
Excel Formula:
=RANK(L2,IF(N2:N1037="Relief",L2:L1037))

This only gives #VALUE. As the function RANK requires a ref.

So, is there a way i can accomplish the goal with the RANK function, of filtering the values in L2:L1037, to reduce them in number, and then get the ranks based on that filtered array? Somehow convert the array described by
Excel Formula:
IF(N2:N1037="Relief",L2:L1037)
to a ref, or something suitable to the RANK function?

Thank you.!
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
You can't turn an array into a reference. It's frustrating that some functions, like RANK, don't allow arrays. I know of no reason why it shouldn't work. So you have to work around it, something like:

Book2
LMN
1
2
31Relief4
44x 
56Relief2
63Relief3
78x 
87Relief1
9
Sheet5
Cell Formulas
RangeFormula
N3:N8N3=IF(M3="Relief",MATCH(L3,SORT(FILTER($L$3:$L$8,$M$3:$M$8="Relief"),1,-1),0),"")


You can change the -1 to a 1 if you want the ranking to be in ascending order.
 
Upvote 0
Solution

Forum statistics

Threads
1,224,818
Messages
6,181,151
Members
453,021
Latest member
Justyna P

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