[Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register]

Author Message
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
ken johnson
Super User

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

 Posted: Sun Apr 22, 2012 2:10 pm    Post subject: 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).
dataweaver
Newbie

Joined: 21 Apr 2012
Posts: 3

 Posted: Sun Apr 22, 2012 4:19 pm    Post subject: I was using 3.1.1; I'm upgrading now.
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 All times are GMT - 8 Hours Page 1 of 1

 Jump to: Select a forum OpenOffice.org Forums----------------Setup and TroubleshootingOpenOffice.org WriterOpenOffice.org CalcOpenOffice.org ImpressOpenOffice.org DrawOpenOffice.org MathOpenOffice.org BaseOpenOffice.org Macros and APIOpenOffice.org Code Snippets Community Forums----------------General DiscussionSite Feedback
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