Bug 94149 - formula in spreadsheet returns inconsistent results in same row. A formula using if ... then works in early parts of spreadsheet and then fails.
Summary: formula in spreadsheet returns inconsistent results in same row. A formula u...
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-11 23:45 UTC by subprobate
Modified: 2015-09-14 00:02 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
basescores spreadsheet (974.36 KB, application/vnd.oasis.opendocument.spreadsheet)
2015-09-13 22:48 UTC, subprobate
Details

Note You need to log in before you can comment on or make changes to this bug.
Description subprobate 2015-09-11 23:45:54 UTC
In a full width spreadsheet with about 50 rows, in sheet number 9, the formula "if(count(range-ONE ROW)> 20, "", if(sum(range-ONE ROW)>0,sum(range-ONE ROW),""))".  The array is C4:AMC47.
The range is from the column of interest to the end of the row: c3:amc3, then d3:amc3, for example.
Results within a row are good for a while and then the sum(range) is displayed.
In the 41th row of calculations (Row 44), the if(sum(range)> 20,"" ... fails in column C from the beginning.
The next instance of failure is in column BH, rows 29 and 46.  The test continues to work in the other rows until column BX when row 22 fails.  The next failure is in column CC row 37, then column CF row 39. And column CO row 31, etc.
In tabular form:
Column  Row
C       44
BH      29, 46
CC      37
CF      39
CO      31
CP      36
CQ      4, 47
CR      15
CV      27
CW      41
CX      12, 16, 23, 25
CY      17, 19, 40
CZ      10
DB      38
DC      8, 32
Comment 1 m_a_riosv 2015-09-11 23:52:52 UTC
Thanks for reporting.

Please attach a sample file to verify the issue, and please remember to delete any private information, this is a public site.
Comment 2 m_a_riosv 2015-09-13 21:18:58 UTC
Hi @subprobate, please answer here not by mail, and attach the file here, except truly difficult to depersonalize it, and in this case please ask here first to send.

I have not clear what error must be founded, I don't find any, but as the file has macros maybe some macro is the source of the problem.

I think it's better concentrate in explain with detailed steps how to achieve one error.
Comment 3 subprobate 2015-09-13 22:48:42 UTC
Created attachment 118685 [details]
basescores spreadsheet

The sheet number 9 is filled with a nested if formula which works in most of the left most cells and then begins to fail.   If the formula is correctly worked there should be no number greater than 19.   An examination of the speadsheet sheet number 9 shows the formula is not correctly interpreted.
Comment 4 m_a_riosv 2015-09-13 23:15:15 UTC
c44: =IF(COUNT(WeeklyRounds.C44:$AMC44)>19;"";IF(SUM(WeeklyRounds.C44:$AMC44)>0;SUM(WeeklyRounds.C44:$AMC44);""))

Into the formula COUNT(WeeklyRounds.C44:$AMC44) is equal 17
So the sum is calculated and showed because is higher than zero.

bh29: =IF(COUNT(WeeklyRounds.BH29:$AMC29)>19;"";IF(SUM(WeeklyRounds.BH29:$AMC29)>0;SUM(WeeklyRounds.BH29:$AMC29);""))

Into the formula COUNT(WeeklyRounds.BH29:$AMC29) is equal 19
So the sum is calculated and showed because is higher than zero.

I guess you know analyzed rows has values higher than one, so the SUM is not equal than COUNT.
Comment 5 subprobate 2015-09-13 23:53:59 UTC
Comment on attachment 118685 [details]
basescores spreadsheet

Operator error.  No bug.  Sorry about that.
Comment 6 m_a_riosv 2015-09-14 00:02:09 UTC
Don't worry, thanks for informing.

As this system is for bugs, if you have some question, please use
http://www.libreoffice.org/get-help/community-support/
where Ask or Mailing List are a good places.