Created attachment 101315 [details] example that demonstrates the bug Problem description: A cell containing an IFERROR() formula does not evaluate to the specified "alternative value" under certain conditions. In the example, the test expression (first parameter of IFERROR()) is itself an expression built with IF(). The inner IF has a condition that cannot be evaluated. Placing the (inner, failing) IF() expression and the (outer) IFERROR() expressions in separate cells produces correct result - "alternative value" specified on 2nd parameter of IFERRROR() is returned. However, if the two cells are merged into a single expression (instead of a reference to the IF() formula, it is copied verbatim inside the IFERROR() formula), the IFERROR does not return the "alternative value", but an error (which is exactly the opposite of why it has been used in the first place - to avoid an error in a cell). Steps to reproduce: 1. open a new sheet 2. place the following formula in any cell: =IFERROR(IF("foo"+1<=1,0,1),"alternative value") 3. observe the result of the formula Current behavior: The formula returns an error Expected behavior: The formula should return "alternative value" Example sheet: The attached example also shows that if the two formulas are placed into separate cells (i.e. the failing IF() is in a cell, and the IFERROR is in another cell that references the first one), then the IFERROR produces a correct value. However, in a single expression, IFERROR produces incorrect value. Operating System: Ubuntu Version: 4.2.3.3 release
It seems that the bug is always present whenever the formula inside iferror has any problems, that is, the bug is not related to IF(). The simpler formula: =IFERROR(0/0,"alternative value") also demonstrates the bug.
Hi Paál, thanks for reporting. Reproducible with sample file: Win7x64Ultimate Version: 4.0.6.2 (Build ID: 2e2573268451a50806fcd60ae2d9fe01dd0ce24) Version: 4.1.6.2 Build ID: 40ff705089295be5be0aae9b15123f687c05b0a Version: 4.2.3.3 Build ID: 882f8a0a489bc99a9e60c7905a60226254cb6ff0 Version: 4.3.0.1.0+ Build ID: e9ef07ed691399119b6bc5f1d2d79222667766c6 TinderBox: Win-x86@42, Branch:libreoffice-4-3, Time: 2014-06-18_10:37:56 Version: 4.4.0.0.alpha0+ Build ID: 836454d0c1a490066f12cbe6327422ffb1065426 TinderBox: Win-x86@39, Branch:master, Time: 2014-06-18_05:57:47 The function was implemented in 4.0, seems this issue has been there from the beginning.
Winfried: one for you?
(In reply to comment #1) > It seems that the bug is always present whenever the formula inside iferror > has any problems, that is, the bug is not related to IF(). > > The simpler formula: =IFERROR(0/0,"alternative value") also demonstrates > the bug. With version 4.2.5 the formula =IFERROR(0/0,"alternative value") works OK. The formula =IFERROR(IF("foo"+1<=1,0,1),"alternative value") does not work OK in 4.2.5 nor in master. I will look into it.
(In reply to comment #4) > With version 4.2.5 the formula =IFERROR(0/0,"alternative value") works OK. Yeah, my mistake. I dont't know what happened. Ignore comment #1 =IFERROR(0/0,"alternative value") works fine on 4.2.3.3 (Ubuntu 14.04 LTS version).
Created attachment 102544 [details] more complete testcase document
Eike Rathke committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=1093b900b43d819c9a730ef6435fed0f3687a085 resolved fdo#80195 act on implicitly propagated error, if any The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Pending review for 4-3-0 at https://gerrit.libreoffice.org/10195 for 4-3 at https://gerrit.libreoffice.org/10196 for 4-2-6 at https://gerrit.libreoffice.org/10199 for 4-2 at https://gerrit.libreoffice.org/10198
Eike Rathke committed a patch related to this issue. It has been pushed to "libreoffice-4-2": http://cgit.freedesktop.org/libreoffice/core/commit/?id=50b9fe07f9851160e12922feb7d96d6f7ae5b52e&h=libreoffice-4-2 resolved fdo#80195 act on implicitly propagated error, if any It will be available in LibreOffice 4.2.7. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Eike Rathke committed a patch related to this issue. It has been pushed to "libreoffice-4-3": http://cgit.freedesktop.org/libreoffice/core/commit/?id=be91c2086afef99dc9569ac6aa4835c5072bffdf&h=libreoffice-4-3 resolved fdo#80195 act on implicitly propagated error, if any It will be available in LibreOffice 4.3.1. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Eike Rathke committed a patch related to this issue. It has been pushed to "libreoffice-4-3-0": http://cgit.freedesktop.org/libreoffice/core/commit/?id=85ad903b57d1d1362f0d9a64ca3de37606645dee&h=libreoffice-4-3-0 resolved fdo#80195 act on implicitly propagated error, if any It will be available already in LibreOffice 4.3.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Eike Rathke committed a patch related to this issue. It has been pushed to "libreoffice-4-2-6": http://cgit.freedesktop.org/libreoffice/core/commit/?id=874859a8feb8cfadd7f491ebae99ff8aa5fd43c7&h=libreoffice-4-2-6 resolved fdo#80195 act on implicitly propagated error, if any It will be available already in LibreOffice 4.2.6. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
*** Bug 81240 has been marked as a duplicate of this bug. ***