Issue 63166 - Summing multiple columns in Matrix formula doesn't work
Summary: Summing multiple columns in Matrix formula doesn't work
Status: CLOSED DUPLICATE of issue 46681
Alias: None
Product: Calc
Classification: Application
Component: code (show other issues)
Version: OOo 2.0
Hardware: Sun Solaris
: P3 Trivial (vote)
Target Milestone: ---
Assignee: spreadsheet
QA Contact: issues@sc
URL:
Keywords: oooqa
Depends on:
Blocks:
 
Reported: 2006-03-14 14:52 UTC by mmusterd
Modified: 2010-11-10 23:49 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
this is a clear example of the described bug (8.03 KB, application/vnd.sun.xml.calc)
2006-03-14 14:52 UTC, mmusterd
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description mmusterd 2006-03-14 14:52:05 UTC
I try to sum a range inside a long table if the date matches a certain criterium.
Say I have one column with the dates, and I am interested in the sum of the
numbers Num1 and Num2 of all dates in a certain month.

Now the matrix selector does work, but only the data in the first column is
added; the other(s) is ignored.

EXAMPLE:
--------

Date	Num1	Num2
01/01/06	4	5
01/02/06	4	5
01/03/06	4	5
01/04/06	4	5
01/05/06	4	5
01/06/06	4	5
01/07/06	4	5
01/08/06	4	5
01/09/06	4	5
01/10/06	4	5
01/11/06	4	5
01/12/06	4	5
01/13/06	4	5
01/14/06	4	5
01/15/06	4	5
01/16/06	4	5
01/17/06	4	5
01/18/06	4	5
01/19/06	4	5
01/20/06	4	5
01/21/06	4	5
01/22/06	4	5
01/23/06	4	5
01/24/06	4	5
01/25/06	4	5
01/26/06	4	5
01/27/06	4	5
01/28/06	4	5
01/29/06	4	5
01/30/06	4	5
01/31/06	4	5
02/01/06	4	5
02/02/06	4	5
02/03/06	4	5
02/04/06	4	5
02/05/06	4	5
02/06/06	4	5

Cell A40 contains 1 feb 2006

I can then insert the formula
{SUM(IF(MONTH(A40)=MONTH(A1:A37);B1:C37))}
and the result is 24, instead of the expected 54.
I can also do
{SUM(IF(MONTH(A40)=MONTH(A1:A37);B1:B37))} (24)
{SUM(IF(MONTH(A40)=MONTH(A1:A37);C1:C37))} (30)
so the principle of the function seems to work, however the adjacent column is
not added at all.

In MS excel it works fine, so there does not appear to be a bug in my logic.. :-)
Comment 1 mmusterd 2006-03-14 14:52:49 UTC
Created attachment 34868 [details]
this is a clear example of the described bug
Comment 2 lars 2006-03-15 16:58:04 UTC
if it didn't exhibit the same mistake, you could use a conditional sum as an 
array formula, {=SUM((MONTH(A40)=MONTH(A2:A38))*$B$2:$C$38)} (shorter); 
confirmed with 680_m158 on WinXP Pro SP2
Comment 3 frank 2006-04-05 12:50:07 UTC
duplicate to Issue 46681

*** This issue has been marked as a duplicate of 46681 ***
Comment 4 frank 2006-04-05 12:50:45 UTC
closed double
Comment 5 grehtietalders 2010-11-10 23:49:10 UTC
Created attachment 73867