Bug 98966 - SUM function error when both column references are absolute and both row references are relative
Summary: SUM function error when both column references are absolute and both row refe...
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: x86 (IA32) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-29 19:11 UTC by Harry Friday
Modified: 2016-03-31 21:50 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
CALC file illustrating SUM bug: example: "=SUM($C10:$G10)" (172.52 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2016-03-30 03:00 UTC, Harry Friday
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Harry Friday 2016-03-29 19:11:05 UTC
User-Agent:       Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36
Build Identifier:  Version: 5.1.0.3       5e3e00a007d9b3b6efb6797a8b8e57b51ab1f737

The SUM function returns "0" instead of a correct sum for the following combination of absolute and relative references (see example below):

=SUM($C201:$G201)

Other combinations of absolute and relative references operate correctly.

Reproducible: Always

Steps to Reproduce:
1.Enter the SUM function in the formula window.
2.Set cell references as shown in the example above
3.
Actual Results:  
Sum of 1,1,3 4 4 -> 0 when cell references are as show in example.
Sum of 1,1,3 4 4 -> 13 for all other cell reference combinations.

Expected Results:  
Sum of 1,1,3 4 4 -> 13 when cell references are as show in example.
Sum of 1,1,3 4 4 -> 13 for all other cell reference combinations.

[Information automatically included from LibreOffice]
Locale: en-US
Module: SpreadsheetDocument
[Information guessed from browser]
OS: Windows XP
OS is 64bit: no


Reset User Profile?No
Comment 1 Joel Madero 2016-03-29 19:34:03 UTC
Please attach a sample file and set the bug back to UNCONFIRMED.

For future reports always (unless it would make absolutely no sense) attach a sample. Thanks
Comment 2 Harry Friday 2016-03-30 02:33:56 UTC
Since the discovery of the SUM bug described below, I have  found that a different spreadsheet which also exhibits a SUM error, but with a significant difference.  In this case the form "=SUM(D20:H20)" sums to zero for any values in the specified cells, but if ANY of the cell references is made absolute, the sum is correctly calculated.  This is sort of the inverse of the reported bug below.  So for example,  "=SUM($D20:H20)" or "=SUM(D$20:H20)" or "=SUM($D20:$H20)", etc. will all calculate the sum correctly.
Comment 3 Joel Madero 2016-03-30 02:39:37 UTC
Again - please attach a sample document. Thanks
Comment 4 Harry Friday 2016-03-30 03:00:55 UTC
Created attachment 123942 [details]
CALC file illustrating SUM bug: example: "=SUM($C10:$G10)"
Comment 5 Harry Friday 2016-03-30 03:04:46 UTC
Please ignore my second comment reporting an error for summations using only relative addressing.  That error cannot be reliably repeated.  The original reported bug remains an issue
Comment 6 raal 2016-03-30 10:27:49 UTC
Hello, after hard recalc CTRL+SHIFT+F9 is SUM in cell I10 correct. Also change of some value in range C:G trigger correct SUM calculation.
You can set recalculation in Tools> Opetions> Calc> Formula > Recalculation on file load

Version: 5.2.0.0.alpha0+ and 5.1.1.3

After recalc F9 the SUM is still incorrect.
Comment 7 raal 2016-03-30 10:32:42 UTC
After recalc F9 the SUM is still incorrect in 5.1.1.3, but correct in 5.2.0.0.alpha0+. You have to stay on cell with SUM formula and press f9.

Please retest with developer version. You can download it here: http://dev-builds.libreoffice.org/daily/master/
Thank you
Comment 8 Harry Friday 2016-03-31 21:50:45 UTC
Thanks, but that build won't install on WinXP - needs Vista or newer.