Bug 96828 - FILEOPEN: XLSX files containing formulae but not values are not recalculated
Summary: FILEOPEN: XLSX files containing formulae but not values are not recalculated
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.2.8.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-30 11:56 UTC by Dave Lambley
Modified: 2016-01-02 09:58 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Example XLSX file which does not correctly import into LibreOffice (4.85 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2015-12-30 11:56 UTC, Dave Lambley
Details
Code to generate XLSX file that incorrectly imports. (224 bytes, application/x-perl)
2015-12-30 11:58 UTC, Dave Lambley
Details
Screen shot of incorrectly imported XLSX file. (26.48 KB, image/png)
2015-12-30 11:58 UTC, Dave Lambley
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Lambley 2015-12-30 11:56:33 UTC
Created attachment 121634 [details]
Example XLSX file which does not correctly import into LibreOffice

When an XLSX file containing formulae but not calculated values is imported into LibreOffice, "0" is incorrectly shown as the result of the calculations.  Microsoft Excel and Google Sheets correctly calculate the values on import.

Such files are easily generated using XLSX generating libraries, I have attached a minimal example.

Best regards,
Dave Lambley
Comment 1 Dave Lambley 2015-12-30 11:58:15 UTC
Created attachment 121635 [details]
Code to generate XLSX file that incorrectly imports.
Comment 2 Dave Lambley 2015-12-30 11:58:54 UTC
Created attachment 121636 [details]
Screen shot of incorrectly imported XLSX file.
Comment 3 MM 2015-12-30 14:01:00 UTC
1) Try a newer version, 4.2.8 is pretty old by now.
2) Set: options > LO Calc > Recalculation.... to 'Always recalculate'.
Comment 4 Dave Lambley 2015-12-30 14:20:23 UTC
Yes, I can reproduce the problem in version 5.0.1.2.

Changing the setting at [Option -> LibreOffice Calc -> Formula -> Excel 2007 and newer] to "Always recalculate" gets the correct value to appear.

Pressing F9 to recalculate, whether "AutoCalculate" is set or not, does not make the correct value appear.
Comment 5 MM 2015-12-30 15:51:56 UTC
(In reply to Dave Lambley from comment #4)
> Pressing F9 to recalculate, whether "AutoCalculate" is set or not, does not
> make the correct value appear.

Hmmmm, shift - ctrl - f9 should do the trick.
Comment 6 Dave Lambley 2015-12-30 15:59:09 UTC
Yes, shift-control-F9 successfully causes calculation. Confirmed in version 4.2.8.2.
Comment 7 raal 2016-01-02 09:58:38 UTC
Tested with Version: 5.2.0.0.alpha0+
Build ID: a27fac3b8f2bae18f62bab315051732df1bb29ab
CPU Threads: 4; OS Version: Linux 4.2; UI Render: default; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2016-01-01_05:08:26

after changing options > LO Calc > Recalculation.... to 'Always recalculate' is value correctly recalculated. In xlsx file is saved value O, so closing as notabug. 

<sheetData>
<row r="1" spans="1:1">
  <c r="A1">
    <v>100</v>
  </c>
</row>
<row r="2" spans="1:1">
  <c r="A2">
   <f>A1</f>
    <v>0</v>    ->  zero here
  </c>
</row>
</sheetData>

File is probably created in excel
<Application>Microsoft Excel</Application>
<AppVersion>12.0000</AppVersion>