=LOOKUP(2;1/(C2:E2<>"");C3:E3) should return the value of D3 if C2:D2 have content each, but returns #DIV/0! error instead. It only works (returning a match for the last subsequently filled cell in the range) if all cells C2:E3 have content.
Eike Rathke committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=a2a15163a6a381957f2cb2ed6fe659577ebde558 Resolves: tdf#116216 array sort order of error values in LOOKUP and MATCH It will be available in 6.1.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 "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=ba490001c2d82c1172854ca16d7099b19e29cb60 Unit test for tdf#116216 It will be available in 6.1.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.
(In reply to Eike Rathke from comment #0) > It only works if all cells C2:E3 have content. That should had been "all cells C2:E2" of course. (Only the range creating the array from to perform the lookup in).
Xisco Fauli committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/bcfad35ee4033e50c351671e9229f9d16c107e67 tdf#116216: sc_ucalc: Add unittest It will be available in 7.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
The unittest added in comment 4 is for bug 141146, not for this issue