[Libreoffice-bugs] [Bug 141989] Calc VLOOKUP from DATA VALIDATION cell returns N/A for two of the validated values

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Fri Apr 30 14:11:25 UTC 2021


https://bugs.documentfoundation.org/show_bug.cgi?id=141989

--- Comment #4 from Mike Kaganski <mikekaganski at hotmail.com> ---
(In reply to Colin from comment #3)
> Is there a reason why it works as expected for 10 of the twelve events?
> Shouldn't it just fail miserably and everything return N/A?

It should not "fail miserably". It doesn't check if the data id sorted (doing
which would require checking all elements, which would defeat the idea of fast
search used in this mode); it just assumes the sorting, and uses binary search
(checking value in the middle; then if wanted value is "less than", it searches
first half, otherwise second half - splitting the range to two halves at each
iteration, and only doing small number of comparisons). At each check it will
naturally find that wanted value is smaller or greater than next checked value,
and finally would arrive to some position - and it may accidentally happen to
be correct, but that would be just a coincidence (as in first successful
results). It would arrive to N/A only if at *each* attempt the wanted value
happened to be smaller than checked position (so lookup arrives to position
"before start").

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20210430/6a41e5ae/attachment.htm>


More information about the Libreoffice-bugs mailing list