https://bugs.freedesktop.org/show_bug.cgi?id=85396

            Bug ID: 85396
           Summary: Bad result of function SUM with matrix
           Product: LibreOffice
           Version: 4.3.2.2 release
          Hardware: Other
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Spreadsheet
          Assignee: [email protected]
          Reporter: [email protected]

Created attachment 108342
  --> https://bugs.freedesktop.org/attachment.cgi?id=108342&action=edit
test file

Steps to reproduce:
1) write data in sheet, cells A1:B3
14    1
2    2
3    3

2) write formula in cell {=SUM(A1:A3<14*B1:B3)}  . Matrix formula (In order to
enter this as an array formula, you must press the Shift+ Ctrl+ Enter)

Actual result: 2

Expected result:5       (1*2+1*3)


See help https://help.libreoffice.org/Calc/Mathematical_Functions#SUM

"Conditions linked by AND can be used with the function SUM() in the following
manner:

Example assumption: You have entered invoices into a table. Column A contains
the date value of the invoice, column B the amounts. You want to find a formula
that you can use to return the total of all amounts only for a specific month,
e.g. only the amount for the period >=2008-01-01 to <2008-02-01. The range with
the date values covers A1:A40, the range containing the amounts to be totaled
is B1:B40. C1 contains the start date, 2008-01-01, of the invoices to be
included and C2 the date, 2008-02-01, that is no longer included.

Enter the following formula as an array formula:

=SUM((A1:A40>=C1)*(A1:A40<C2)*B1:B40)

In order to enter this as an array formula, you must press the Shift+ Ctrl+
Enter keys instead of simply pressing the Enter key to close the formula. The
formula will then be shown in the Formula bar enclosed in braces.

{=SUM((A1:A40>=C1)*(A1:A40<C2)*B1:B40)}

"
The formula is based on the fact that the result of a comparison is 1 if the
criterion is met and 0 if it is not met. The individual comparison results will
be treated as an array and used in matrix multiplication, and at the end the
individual values will be totaled to give the result matrix.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to