Bug 131541 - Calc seems to miscalculate when using subtotals but not with sum
Summary: Calc seems to miscalculate when using subtotals but not with sum
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.3.5.2 release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Function-Subtotal
  Show dependency treegraph
 
Reported: 2020-03-24 16:15 UTC by energo
Modified: 2020-05-17 21:24 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Here is a sample of the error (17.93 KB, application/vnd.oasis.opendocument.spreadsheet)
2020-03-24 18:16 UTC, energo
Details
I think this narrows it down (78.74 KB, image/png)
2020-03-24 20:14 UTC, energo
Details
the correct formulas (18.29 KB, application/vnd.oasis.opendocument.spreadsheet)
2020-05-17 21:23 UTC, BogdanB
Details

Note You need to log in before you can comment on or make changes to this bug.
Description energo 2020-03-24 16:15:52 UTC
Description:
CHF 4.50	s
CHF 9.00	s
CHF 3.90	s
CHF 0.95	s
CHF 5.70	s
CHF 2.60	s
22.15	s Sum
Calc seems to miscalculate when using subtotals but not with sum 
CHF 4.50	s
CHF 9.00	s
CHF 3.90	s
CHF 0.95	s
CHF 5.70	s
CHF 2.60	s
CHF 26.65	s Sum


Steps to Reproduce:
1. Refer to cut and paste in the description.
2. Calculate using subtotal
3. Calculate using sum

Actual Results:
see first cut and paste

Expected Results:
see second cut and paste


Reproducible: Always


User Profile Reset: No



Additional Info:
I don't know what else I can add. One way it is incorrect and another way it works. For me it means that libre office calc is not reliable.
Comment 1 Xavier Van Wijmeersch 2020-03-24 17:58:23 UTC
i can not reproduce

Version: 6.3.4.2
Build ID: 60da17e045e08f1793c57c00ba83cdfce946d0aa
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3; 
Locale: nl-BE (en_US.UTF-8); UI-Language: en-US
Calc: threaded
Comment 2 energo 2020-03-24 18:16:44 UTC
Created attachment 158954 [details]
Here is a sample of the error

Hi, we are in lockdown and I ordered groceries for ourselves and our neighbour. I separated the costs using Calc and noticed the difference in results. If you could point out where I went wrong or confirm the bug I would be grateful.
Mark
Comment 3 Roman Kuznetsov 2020-03-24 19:53:05 UTC
You have a mistake in formula for B8 and B19 cells. Why is B2:B7 range for SUBTOTAL and B1:B7 range for SUM?

Please check your target in your file
Comment 4 energo 2020-03-24 20:14:46 UTC
Created attachment 158957 [details]
I think this narrows it down

Thank you for your response. If I select the entire block and click on data>subtotals it selects b2 to b7 as if b1 was a heading which was to be ignored. I didn't expect this behaviour.
Comment 5 QA Administrators 2020-03-25 02:41:39 UTC Comment hidden (obsolete)
Comment 6 BogdanB 2020-05-17 21:23:42 UTC
Created attachment 160955 [details]
the correct formulas

Your formulas are wrong.
See your file with correct formulas.