help asked for Calc jump function with empty arguments

Eike Rathke erack at redhat.com
Mon Feb 2 08:18:36 PST 2015


Hi Winfried,

On Monday, 2015-02-02 13:08:54 +0100, Winfried Donkers wrote:

> >> With IFERROR and IFNA these situation should return an empty value to be compatible with Excel.
> >AFAIK also Excel does not allow a null argument for IFERROR() second parameter, but I'm not sure, I'd have to check.

Ok, I tried and it does allow the second argument to be nil.

> Excel replaces an empty argument with an empty value, that is to say, the function description says 
> 'If value or value_if_error is an empty cell, IFERROR treats it as an empty string value ("").'

That's not what Excel does.
* If the first argument ('value') is a reference to an empty cell it is
  simply propagated through because it is not an error.
* If the second argument ('value_if_error') is a reference to an empty
  cell in an error case the empty cell is returned.

Empty cell versus empty string is specifically a difference when
displaying or further processing the return value, e.g.
=IF(IFERROR(A2,)=0,23,42) and
=IF(IFERROR(A2,)="",23,42) and
=IF(IFERROR(A2,A3)=0,23,42) and
=IF(IFERROR(A2,A3)="",23,42)
in Excel all evaluate to 23 if A2 is empty or contains an error and A3
is empty. If IFERROR returned an empty string in any of these cases the
corresponding comparison with numeric 0 would result in FALSE.

> and =IFERROR(1/0;) returns an empty cell, not an error message.

This is correct and voids my earlier proposal to propagate the ocMissing
token through in the final result. Actually we need to pop an ocMissing
and push an ScEmptyCellToken in such case.

  Eike

-- 
LibreOffice Calc developer. Number formatter stricken i18n transpositionizer.
GPG key "ID" 0x65632D3A - 2265 D7F3 A7B0 95CC 3918  630B 6A6C D5B7 6563 2D3A
Better use 64-bit 0x6A6CD5B765632D3A here is why: https://evil32.com/
Care about Free Software, support the FSFE https://fsfe.org/support/?erack
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20150202/c54606e8/attachment.sig>


More information about the LibreOffice mailing list