dataweaver Newbie
Joined: 21 Apr 2012 Posts: 3

Posted: Sun Apr 22, 2012 9:45 am Post subject: [SOLVED] Range Parameters and Array Functions 


I recently learned that I can use a formula instead of a simple cell reference in functions like Sum(). For example:
A1:D1 contains 1, 2, 3, 4
SUM(A1:D1) = 10 (i.e., 1+2+3+4)
SUM(A1:D1+1) = 14 (i.e., 2+3+4+5)
However, there seems to be one caveat: there must be exactly one Range referenced in the formula. If multiple ranged are referenced, unexpected things happen such as !VALUE errors or the ranges each effectively being replaced in the formula by references to their rightmost cells. For example:
A1:D2 = 1, 2, 3, 4; 1, 3, 5, 7
SUM (A1:D1 * A1:D1) = 16 (i.e., 4*4)
SUM(A1:D2 * A1:D2) = !VALUE (apparently, this happens when the ranges have multiple rows and multiple columns)
The kicker is that I can enter A1:D1 * A1:D1 as an Array Formula, and it behaves as I'd expect:
{A1:D1 * A1:D1} = 1, 4, 9, 16 (i.e., 1*1, 2*2, 3*3, 4*4)
{A1:D2 * A1:D2} = 1, 4, 9, 16; 1, 9, 25, 49 (i.e., 1*1, 2*2, 3*3, 4*4; 1*1, 3*3, 5*5, 7*7)
â€¦and I can then SUM those without any problems. So the capability to evaluate a formula that references multiple arrays and produces an array exists, and works as I'd expect; but using that capability in a function's range parameter seems to be only partially implemented, only working as expected (or at all) when only a single range reference is involved in the embedded array formula.
I know that I can use SUMPRODUCT to handle this particular example; but not everything is going to be amenable to such a solution:
SUM(A2:D2^A1:D1) = 1
MAX(A1:D2*A1:D2) = !VALUE
Am I missing something? If not, what can be done to address this issue?
Last edited by dataweaver on Sun Apr 22, 2012 4:18 pm; edited 1 time in total 
