OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

[SOLVED] Range Parameters and Array Functions

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc
View previous topic :: View next topic  
Author Message
dataweaver
Newbie
Newbie


Joined: 21 Apr 2012
Posts: 3

PostPosted: Sun Apr 22, 2012 9:45 am    Post subject: [SOLVED] Range Parameters and Array Functions Reply with quote

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
Back to top
View user's profile Send private message
ken johnson
Super User
Super User


Joined: 23 Apr 2009
Posts: 2032
Location: Sydney, Australia

PostPosted: Sun Apr 22, 2012 2:10 pm    Post subject: Reply with quote

I use OOo 3.3.0 and cannot reproduce your problem.
{=MAX(A1:D2*A1:D2)} returns 49 when using the A1:D2 values you supplied.
What version of OOo are you using?
Earlier versions did have some array formula deficiencies.

Ken Johnson
_________________
If your problem has been solved please add "[Solved]" to the beginning of your first post title (edit button).
Back to top
View user's profile Send private message
dataweaver
Newbie
Newbie


Joined: 21 Apr 2012
Posts: 3

PostPosted: Sun Apr 22, 2012 4:19 pm    Post subject: Reply with quote

I was using 3.1.1; I'm upgrading now.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group