Bug 88576 - functions IFNA and IFERROR second argument
Summary: functions IFNA and IFERROR second argument
Status: ASSIGNED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Spreadsheet (show other bugs)
Version: 4.3.5.2 release
Hardware: Other All
: medium normal
Assignee: Winfried Donkers
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-19 09:42 UTC by raal
Modified: 2015-01-23 16:41 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
test documents before and after the export to xlsx (15.21 KB, application/x-compressed)
2015-01-19 09:42 UTC, raal
Details
use cases jump functions (4.80 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2015-01-23 16:41 UTC, Winfried Donkers
Details

Description raal 2015-01-19 09:42:35 UTC
Created attachment 112452 [details]
test documents before and after the export to xlsx

In bug 59819 functions IFNA and IFERROR was added.

According to specification is second argument of functions mandatory.

spec> http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part2.html#__RefHeading__1018448_715980110

Calc allows create functions without second argument and returns results. After export to XLSX this create incompatibility.
Also export of function IFNA to XLSX is broken (same symptoms as in bug 59819). 
Steps to reproduce Error1:
- open iferror_ifna_second argument.ods
- save as .xlsx
- open in excel

Actual results
Error message: broken file, repair. After repair:
A1 = 1 (cached value; formula lost)
A2= =_xlfn.IFNA(F1)

***
IFERROR with second argument is correctly exported to .xlsx.  
IFNA with second argument is not correctly exported to .xlsx -> =_xlfn.IFNA(E1;E2)

Tested with LO 4.3.5, win7
Comment 1 raal 2015-01-19 12:02:13 UTC
According to MS help (https://support.office.com/en-nz/article/IFNA-function-6626c961-a569-42fc-a49d-79b4951fd461?ui=en-US&rs=en-NZ&ad=NZ) is function IFNA for for Excel 2013 - i tested with Excel 2010 => saving IFNA is probably correct.
Comment 2 Winfried Donkers 2015-01-19 12:09:00 UTC
I will investigate.
Comment 3 Winfried Donkers 2015-01-19 16:30:23 UTC
Calc's IFERROR and IFNA function use the same code. The code does not check the number of arguments.
Neither does the code use an empty string as second argument when not given (as is the case with the Excel functions IFERROR and IFNA).

I set the status to new.

I suggest we use the Excel behaviour in Calc too, and put this as an OpenFormula extension in the wiki (https://wiki.documentfoundation.org/Development/ODF_Implementer_Notes/List_of_LibreOffice_OpenFormula_Extensions).

Eike, Raal, do you agree?
Comment 4 raal 2015-01-19 19:13:04 UTC
(In reply to Winfried Donkers from comment #3)
Hello,

> I suggest we use the Excel behaviour in Calc too, and put this as an
> OpenFormula extension in the wiki
> (https://wiki.documentfoundation.org/Development/ODF_Implementer_Notes/
> List_of_LibreOffice_OpenFormula_Extensions).
> 
> Eike, Raal, do you agree?

Tested iferror with excel2010 and excel doesn't allow to create formula with only one argument,  so we should do the same
Comment 5 Winfried Donkers 2015-01-20 12:59:14 UTC
(In reply to raal from comment #4)
> Tested iferror with excel2010 and excel doesn't allow to create formula with
> only one argument,  so we should do the same

OK, that's clear. I will start working on a fix.
Comment 6 Winfried Donkers 2015-01-23 16:41:17 UTC
Created attachment 112732 [details]
use cases jump functions

@Raal:
Could you please copy the results from Excel into row B, so that I can use that to compare the behaviour?

As you can see, IFERROR( a ) is no longer accepted, but empty arguments still are (until they are to be returned).
IFNA is not in the document as the code is shared with IFERROR.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.