INDIRECT Function In An Array Formula Getting a #REF Error

excelbytes

Active Member
Joined
Dec 11, 2014
Messages
251
Office Version
  1. 365
Platform
  1. Windows
Here is my formula:
=IFERROR(INDEX(Holdings!$D$2:$D$7,SMALL(IF((INDIRECT("Holdings!$W$2:$W$7"&C13&"search!$D$13")),ROW(Holdings!$D$2:$D$7)-MIN(ROW(Holdings!$D$2:$D$7))+1),ROWS($D$7:$D$7))),"")
Holdings!$W$2:$W$7 is a series of percentages
C13 is the ">" symbol
search!$D$13 is 5%
When I highlight the ref_text for the INDIRECT function and hit F9, I get INDIRECT("Holdings!$W$2:$W$7>search!$D$13")
However, when I highlight (INDIRECT("Holdings!$W$2:$W$7"&C13&"search!$D$13") and hit F9 I get a #REF error.
What am I missing?
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Indirect is only meant to produce ranges, not formulas / calculations. Checking if one value is greater than another is a calculation so is not valid syntax for the indirect function.
 
Upvote 0
Not entirely sure what the full purpose of your formula is, but assuming that C13 would be either > or < you would need to use something like this.
More options in C13 will mean a more complex formula.
Excel Formula:
=IFERROR(IF(C13=">",AGGREGATE(15,6,Holdings!$D$2:$D$7/(Holdings!$W$2:$W$7>search!$D$13),ROWS(D$7:D$7)),AGGREGATE(15,6,Holdings!$D$2:$D$7/(Holdings!$W$2:$W$7<search!$D$13),ROWS(D$7:D$7))),"")
 
Upvote 0
The reason I tried this was to be able to change the ">" symbol to =, or <, or ... Is there an alternative approach?
 
Upvote 0
Try (untested)
Excel Formula:
=IFERROR(IF(C13=">",AGGREGATE(15,6,Holdings!$D$2:$D$7/(Holdings!$W$2:$W$7>search!$D$13),ROWS(D$7:D$7)),IF(C13="<",AGGREGATE(15,6,Holdings!$D$2:$D$7/(Holdings!$W$2:$W$7<search!$D$13),ROWS(D$7:D$7)),AGGREGATE(15,6,Holdings!$D$2:$D$7/(Holdings!$W$2:$W$7=search!$D$13),ROWS(D$7:D$7)))),"")
 
Upvote 0
Solution

Forum statistics

Threads
1,215,001
Messages
6,122,648
Members
449,092
Latest member
peppernaut

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