I would be grateful if anyone knows whether the following issue is documented and/or what the underlying reasons are.
Assuming we have, for example, the numbers from 1 to 10 in A1:A10
, the following formula
=SUMPRODUCT(SUBTOTAL(4,OFFSET(A1,{0;5},0,5)))
is perfectly valid and is equivalent to taking the sum of the maximum values from each of the ranges A1:A5
and A6:A10
, since the OFFSET
function, here being passed an array of values ({0;5}
) as its rows parameter and with the appropriate height parameter (5), resolves to the array of ranges:
{A1:A5,A6:A10}
which is then passed to SUBTOTAL
to generate a further array comprising the maximum values from each of those ranges, i.e. 5 and 10, before being summed by SUMPRODUCT
.
AGGREGATE
was introduced in Excel 2010 as, it would seem, a more refined version of SUBTOTAL
. My question is why, when attempting the following
=SUMPRODUCT(AGGREGATE(14,,OFFSET(A1,{0;5},0,5),1))
which should be equivalent to the SUBTOTAL
example given above, does Excel display the message that it "Ran Out of Resources While Attempting to Calculate One or More Formulas" (and return a value of 0)?
(Note that users of a non-English-language version of Excel may require a different separator within the array constant {0;5}
.)
This is a quite unexpected error. Evidently the syntax is not at fault, nor is the passing of the OFFSET
construction 'disallowed'. With nothing else in the workbook, what is causing Excel to use so much resource when attempting to resolve such a construction?
A similar result occurs with INDIRECT
instead of OFFSET
, i.e.
=SUMPRODUCT(SUBTOTAL(4,INDIRECT({"A1:A5","A6:A10"})))
is perfectly valid, yet
=SUMPRODUCT(AGGREGATE(14,,INDIRECT({"A1:A5","A6:A10"}),1))
gives the same error described above.
Regards