Bug 98756 - Editing: SUM(IF(MONTH($A$2:$A$366)=E4;$B$2:$B$366;0)) giving wrong result
Summary: Editing: SUM(IF(MONTH($A$2:$A$366)=E4;$B$2:$B$366;0)) giving wrong result
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-18 19:05 UTC by Jānis Eisaks
Modified: 2016-03-20 22:28 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
document demonstrating wrong behaviour (24.58 KB, application/vnd.oasis.opendocument.spreadsheet)
2016-03-18 19:05 UTC, Jānis Eisaks
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jānis Eisaks 2016-03-18 19:05:46 UTC
Created attachment 123699 [details]
document demonstrating wrong behaviour

Hi!

During the trial and error I found that something is wrong with the construct:
=SUM(IF(MONTH($A$2:$A$366)=1;$B$2:$B$366;0))

I have the dates from the 1st of Jan to 31 of Dec, I can't get the right results (for the test - the right count of the days - the construct sums everything in the range for the month value=1, for other values the result is zero) - see attachment.

Janis
Comment 1 Jānis Eisaks 2016-03-18 19:37:27 UTC
for unknown reasons Ctrl+Shift+Enter does not convert the formula to array - found unintentionally exploring Function wizard (v. 5.0.4, Slack 14.1-64)
Comment 2 m_a_riosv 2016-03-20 22:28:39 UTC
If you are going to convert in array the formula, you need first to change something before use Ctrl+Shift+Enter, like add an space to the end.

OTOH, in many array formulas it's easy to use SUMPRODUCT() function because it is an array function, and you don't need the Ctrl+Shift+Enter.