Bug 123922 - a cell with function is not evaluate properly
Summary: a cell with function is not evaluate properly
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.2.0.3 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-07 09:47 UTC by Nicolas
Modified: 2019-03-09 19:48 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Cell D13 should probably return an integer when referenced (274.00 KB, application/vnd.ms-excel)
2019-03-07 09:47 UTC, Nicolas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas 2019-03-07 09:47:48 UTC
Created attachment 149785 [details]
Cell D13 should probably return an integer when referenced

The cell E15 is containing a function which is not evaluate properly.
This file is working fine, ie the cell function is evaluate correctly, with MS office and imported correctly by Google doc. There are something which is not working as expected with LibreOffice.
I am suspecting that the problem is in reality with the cell D13 which is giving an integer on Google doc.

Thanks for libreoffice.
Comment 1 m_a_riosv 2019-03-08 03:36:48 UTC
What values should be D13 and E15
Comment 2 Nicolas 2019-03-08 09:54:50 UTC
In E15: 20 (20 jours ouvrés dans le mois)

In D13: what is show (a list of month) is correct but the result when interrogating for the cell should be an integer: 43497

And C13 (which seems to be linked to D13): 26

I honestly do not understand the function inside this sheet. It was given to me by a coworker and I was not able to use it with libreoffice so the bug report.
Comment 3 Oliver Brinzing 2019-03-08 18:10:32 UTC
it seems to work if you change the sheetname in the functions from
"calendar!D" to LO syntax "calendar.D"

D13:  =INDIRECT("calendar.D"&(C13+1))

E15:  =SUMIF(B18:B48;">0";C18:C48)+(SUMIF(B18:B48;">0";D18:D48))&"
      ("&INDIRECT("calendar.E"&(C13+1))&" jours ouvrés dans le mois)"

according to

https://help.libreoffice.org/6.1/en-US/text/scalc/01/04060109.html?DbPAR=CALC#bm_id3153181

> If you open an Excel spreadsheet that uses indirect addresses calculated from 
> string functions, the sheet addresses will not be translated automatically.
> For example, the Excel address in INDIRECT("filename!sheetname"&B1) is not
> converted into the Calc address in INDIRECT("filename.sheetname"&B1).

this is not a bug
Comment 4 Nicolas 2019-03-08 19:32:21 UTC
Thanks a lot. Indeed it solved my problem. I am not completely agree about not a bug. That happens not with an ODF file but an docx import and if I modify the file as you mention to solve the problem on LO, the same problem is happening now (with the .) on Excel. 

I found it problematic because that gave argument to my colleague that I should not use LO since to share document is problematic.

Thanks anyway for the information.
Comment 5 Oliver Brinzing 2019-03-08 20:25:00 UTC
(In reply to Nicolas from comment #4)
> Thanks a lot. Indeed it solved my problem. I am not completely agree about
> not a bug. That happens not with an ODF file but an docx import and if I
> modify the file as you mention to solve the problem on LO, the same problem
> is happening now (with the .) on Excel. 

you could try something like this:

=IF(ISERROR(INDIRECT("calendar!D"&(C13+1)));INDIRECT("calendar.D"&(C13+1));INDIRECT("calendar!D"&(C13+1)))
Comment 6 Nicolas 2019-03-08 21:42:48 UTC
I agree but my point is that it is impossible to ask a MS excel user to do it. They will not understand the reason. I think that the behaviour should be different if the file is xlsx or on ODF but I am thinking in term of interoperability and try to convince people that LO can be used in a professional environment.
Comment 7 m_a_riosv 2019-03-08 22:48:30 UTC
There is an option Menu/Tools/Options/LIbreOffice calc/Formula - Detailed Calculation Setting - Custom - Reference syntax for string reference, that I think should solve the issue selecting 'Calc A1 | Excel A1' or 'Excel A1'
file:///C:/Program%20Files/LibreOffice/help/en-US/text/shared/optionen/detailedcalculation.html?System=WIN&DbPAR=CALC&HID=modules/scalc/ui/formulacalculationoptions/help#@@nowidget@@
Comment 8 Nicolas 2019-03-09 19:48:20 UTC
Thanks that did the trick. Sorry to have bother you.