Bug 143362 - Different results between Calc and Excel for SUMIFS formula
Summary: Different results between Calc and Excel for SUMIFS formula
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.3.0.0 alpha0+
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-14 14:42 UTC by Elmar
Modified: 2021-07-19 08:46 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
the excel doc (934.93 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2021-07-14 15:00 UTC, Elmar
Details
excel result screenshot (53.20 KB, image/png)
2021-07-14 15:00 UTC, Elmar
Details
calc result screenshot (44.45 KB, image/png)
2021-07-14 15:01 UTC, Elmar
Details
compared to example on internet (17.03 KB, application/vnd.oasis.opendocument.spreadsheet)
2021-07-14 15:31 UTC, Elmar
Details
updated sspreadhseet to include an excample from MS (19.45 KB, application/vnd.oasis.opendocument.spreadsheet)
2021-07-14 15:41 UTC, Elmar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Elmar 2021-07-14 14:42:24 UTC
Description:
I received a spreadsheet from an excel user, which when I opened it in Calc did not present same results.

Steps to Reproduce:
1.open xlsx
2.
3.

Actual Results:
see sheet Summary in Calc cp. to Excel
I have included screenshots for both

Expected Results:
should produce same results


Reproducible: Always


User Profile Reset: No



Additional Info:
[Information automatically included from LibreOffice]
Locale: en-GB
Module: SpreadsheetDocument
[Information guessed from browser]
OS: Linux (All)
OS is 64bit: yes
Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: 7c1bad415ae48635dc67041c413bb7b76a530c22
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: en-GB (en_GB.UTF-8); UI: en-GB
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2021-07-05_06:55:03
Calc: threaded
Comment 1 Elmar 2021-07-14 15:00:15 UTC
Created attachment 173575 [details]
the excel doc
Comment 2 Elmar 2021-07-14 15:00:50 UTC
Created attachment 173576 [details]
excel result screenshot
Comment 3 Elmar 2021-07-14 15:01:23 UTC
Created attachment 173577 [details]
calc result screenshot
Comment 4 Elmar 2021-07-14 15:02:19 UTC
Note: I a using the Office 365 version of excel
Comment 5 Elmar 2021-07-14 15:31:22 UTC
Created attachment 173578 [details]
compared to example on internet

This is a simple example, but it actually gives the same result as excel.

The calculations are rather convoluted, but should still produce the same result?
Comment 6 Eike Rathke 2021-07-14 15:36:20 UTC
Your screenshots show different data content, make at least sure you are comparing the same documents.
Comment 7 Elmar 2021-07-14 15:41:54 UTC
Created attachment 173579 [details]
updated sspreadhseet to include an excample from MS
Comment 8 Eike Rathke 2021-07-14 15:48:13 UTC
(In reply to Elmar from comment #7)
> Created attachment 173579 [details]
> updated sspreadhseet to include an excample from MS
That document has regular expressions enabled, which calculates the criterion "=A*" differently. Switch to Excel compatible wildcards instead and you'll get the same 20 result, Tools -> Options -> Calc -> Calculate, Formulas Wildcards, Enable wildcards in formulas.
Comment 9 Eike Rathke 2021-07-14 16:09:43 UTC
(In reply to Eike Rathke from comment #6)
> Your screenshots show different data content, make at least sure you are
> comparing the same documents.
So that's actually because the value in B1 is already different, Excel 41831, Calc 41466 (date value of 2013-07-11); which in the Calc case is the value of LifeCycle.K2421 and thus the first date is 2014-03-31 whereas in the Excel case it is 2015-03-31 (unknown origin) and thus one data point less.

Where's the 41831 cell content taken from in MIN(LifeCycle.K:K) in Excel?
Comment 10 Eike Rathke 2021-07-14 16:32:22 UTC
Fwiw, the results are the same as in Excel if the document is recalculated, hit Shift+Ctrl+F9
Comment 11 Eike Rathke 2021-07-14 16:52:03 UTC
The document is not an original Excel document but was stored using a LibreOfficeDev/7.2.0.0.alpha1 version. The stored values don't match the actual calculation, hence the (wrong) cached values are displayed until recalculated. My slightly behind 7.2.0.0.beta1+ calculates as expected. As does 7.3.0.0.alpha0+ and my slightly behind 7.1.5.0.1+

I think there's nothing to fix, the document has stored wrong values and needs to be recalculated.