Nested Array Formulas and Array Constants

neonangel

Board Regular
Joined
Jul 5, 2004
Messages
99
Hi all,

I have the following formula:

=SUMPRODUCT($C$3:C7,INDIRECT("R"&ROW($D$3)+ROW(D7)-ROW($D$3:D7)&"C"&COLUMN($D$3),FALSE))

Which is designed to take a series of numbers as follows

0.4 0.2
0.3 0.2
0.2 0.2
0.1 0.2
0.0 0.2

in columns C and D, and sumproduct the first set of numbers with the reverse of the second set of numbers. ignore the actual numbers for the moment as this problem is going to be generalized.

When I evaluate the output of the INDIRECT function using F9 I get {0.2;0.2;0.2;0.2;0.2} and substituting this array constant in place of the formula that gave me the array constant gives me the correct result.

Why is it that I can't use an array formula within another array formula, when evaluating the inner array formula gives me the exact component needed to make the outer array formula work? How can I fix this?

Regards,

Alex
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Hi!

Just a guess, but i think that the arguments of your sumproduct wont give you equal size of arrays.Sumproduct requires that all its arguments must have same size of arrays.From your formula above it seems that the first argument and the second one does not have same sizes.
Code:
=sumpriduct(array1,array2,array3)
in which all arrays must have the same dimensions of NxM.
 
Upvote 0
nup..

"When I evaluate the output of the INDIRECT function using F9 I get {0.2;0.2;0.2;0.2;0.2}"

the second expression has five elements, the first clearly has 5.
 
Upvote 0
You need an additional round of evaluation [ with N() ] regarding the INDIRECT bit because of the dereferencing problem...

=SUMPRODUCT($C$3:C7,N(INDIRECT("R"&ROW($D$3)+ROW(D7)-ROW($D$3:D7)&"C"&COLUMN($D$3),FALSE)))
 
Upvote 0
Hi,

Maybe a simpler alternative:

=SUMPRODUCT($C$3:C7,N(OFFSET(D7,ROW($D$3)-ROW($D$3:D7),0)))
 
Upvote 0
And as an incidental, if you fix rows but not columns using $, the formula becomes portable, so you can copy it to somewhere else and it will always act upon the previous two columns.

Thanks all for the assistance,

Regards,

Alex.
 
Upvote 0

Forum statistics

Threads
1,215,839
Messages
6,127,191
Members
449,368
Latest member
JayHo

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