Bug 91590 - SUM function miscalculates
Summary: SUM function miscalculates
Status: CLOSED WONTFIX
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.3.7.2 release
Hardware: All All
: medium major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 92048 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-05-24 19:30 UTC by Juanjo
Modified: 2015-06-17 09:30 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
SUM of the Rate column is not correctly calculated in cell D16 (33.27 KB, application/vnd.oasis.opendocument.spreadsheet)
2015-05-24 19:30 UTC, Juanjo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Juanjo 2015-05-24 19:30:26 UTC
Created attachment 115996 [details]
SUM of the Rate column is not correctly calculated in cell D16

Steps:
1. Open the attached file (Sample_document.ods)
Result: Cell D16 contains a the following formula: =SUM(D2:D15)
        It shows "148" as the outcome of this formula

2. Select an empty cell in this document
3. Write the very same formula in this empty cell (=SUM(D2:D15))
Result: It shows "195" as the outcome of this formula which, by the way, is the right answer
Comment 1 MM 2015-05-24 21:58:27 UTC
Confirmed with v4.4.3.2 under windows 7 x64.
Confirmed with v4.3.7.2 under mint 17.1 x64.
Unconfirmed with v4.2.8.2 under mint 17.1 x64.

Can be reproduced by set 'calculate' > 'case sensitive' to 'on' and 'Formula' > 'ODF...' to 'never recalculate'.
When the file is loaded, set 'case sensitive' to 'off' and the outcome becomes correctly straightaway. Or when 'Formula' > 'ODF...' is set to 'always recalculate' When the file is loaded the outcome is also correct.

These settings (on or off) don't matter with the 4.2 branch, the outcome is always correct.
Comment 2 Buovjaga 2015-06-13 17:35:08 UTC
Confirmed that 4.2 shows ok. Adding bibisect request.

Ubuntu 15.04 64-bit 
Version: 5.1.0.0.alpha1+
Build ID: a9286c302e96258f32d13fb66aced25750e82cd3
TinderBox: Linux-rpm_deb-x86_64@46-TDF-dbg, Branch:master, Time: 2015-06-13_00:35:08
Locale: en-US (en_US.UTF-8)

Version: 4.2.8.2
Build ID: 48d50dbfc06349262c9d50868e5c1f630a573ebd
Comment 3 Eike Rathke 2015-06-17 09:17:10 UTC
There isn't much we can do about. The value 148 is stored in the file and unless explicitly told Calc does not recalculate formulas any more when loading a document. Recalculation of course is also done when calculation options are changed, which is why changing case sensitivity has an effect. Any other calculation option or doing a hard recalc (Shift+Ctrl+F9) does the same.

The document was created with
LibreOffice/4.2.0.3$Windows_x86 LibreOffice_project/c63c03decdf780d8fb80823950665b782ec9ecd0

so maybe that had a bug in not updating calculated values before saving the document.
Comment 4 Eike Rathke 2015-06-17 09:30:53 UTC
*** Bug 92048 has been marked as a duplicate of this bug. ***