Bug 161727 - LOOKUP works in 7.0.4.2 but not in 7.6.7.2
Summary: LOOKUP works in 7.0.4.2 but not in 7.6.7.2
Status: CLOSED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.4.0.3 release
Hardware: All All
: high major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Cell-Formula
  Show dependency treegraph
 
Reported: 2024-06-21 11:21 UTC by photon2537a@gmail.com
Modified: 2024-06-25 13:38 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
LOOKUP works with Libreoffice 7.0.4.2 but not 7.6.7.2 (11.04 MB, application/vnd.oasis.opendocument.spreadsheet)
2024-06-21 11:21 UTC, photon2537a@gmail.com
Details

Note You need to log in before you can comment on or make changes to this bug.
Description photon2537a@gmail.com 2024-06-21 11:21:19 UTC
Created attachment 194879 [details]
LOOKUP works with Libreoffice 7.0.4.2 but not 7.6.7.2

LOOKUP works as I expected in version 7.0.4.2
LOOKUP does not work as I expected in version 7.6.7.2 (basically does not work).

Mac mini late 2018, 64Gb Ram, 3.6 GHz Quad-Core Intel Core i3, Ventura 13.6.6 (22G630)
Have not tried any other hardware.
Comment 1 Xisco Faulí 2024-06-21 12:16:26 UTC
Regression introduced by:

author	Luboš Luňák <l.lunak@collabora.com>	2022-05-06 09:59:01 +0200
committer	Luboš Luňák <l.lunak@collabora.com>	2022-05-10 16:24:13 +0200
commit 6a5464b800aa0b0ce35d602fd008b555d96a94af (patch)
tree 4a9d605f675f6e540294ff9abfa9c322f0735482
parent dce09d33aabfbad405f1accf02c14f8e85da8f6d (diff)
make query iterator's BinarySearch() find the last matching item

Bisected with: bibisect-linux64-7.4

Adding Cc: to Luboš Luňák
Comment 2 ady 2024-06-21 14:03:09 UTC
(In reply to Xisco Faulí from comment #1)
> Regression introduced by:
> Adding Cc: to Luboš Luňák

If you set this report as a high priority, then someone else should be CC'ed (too); I'll let you suggest who.
Comment 3 Stéphane Guillou (stragu) 2024-06-21 14:35:28 UTC
Just like in bug 153297, isn't the issue that the search vector, column G, is not sorted?
Comment 4 ady 2024-06-21 15:03:54 UTC
(In reply to Stéphane Guillou (stragu) from comment #3)
> Just like in bug 153297, isn't the issue that the search vector, column G,
> is not sorted?

Not exactly the same, but close.

The third argument in MATCH() might require some sorting of the data, but LOOKUP() does not have such argument.

BUT, quoting the Help for LOOKUP:

"the search vector for the LOOKUP must be sorted ascending, otherwise the search will not return any usable results."

In Excel the documentation is slightly different. It says that the sorting requirement applies to the array form of LOOKUP(), but says nothing about the vector form. And indeed, the results in Excel seem to be as they were in older LO versions. Whether those results are not really meaningful (i.e. just happens to throw some result according to whichever the algorithm finds), IDK.
Comment 5 Stéphane Guillou (stragu) 2024-06-22 04:29:30 UTC
Eike, you advice would be appreciated here too :)
Comment 6 Eike Rathke 2024-06-25 13:38:05 UTC
For LOOKUP() the lookup vector must be strictly sorted ascending. If it is not then results are arbitrary. Data in column G is not sorted.