[Libreoffice-bugs] [Bug 54255] MATCH does not find empty cells

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Fri Nov 29 20:13:27 UTC 2019


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

David Lynch <david_lynch at blueyonder.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|CLOSED                      |REOPENED
         Resolution|NOTABUG                     |---

--- Comment #17 from David Lynch <david_lynch at blueyonder.co.uk> ---
I agree that the help page does not indicate that it would be possible to find
an empty cell. But, I think that the current behaviour of MATCH (etc) is
incompatible with Open Formula (version 1.2) and so should be considered a bug.
Nowhere in the specification is an exception allowed for empty cells:
"
6.14.9MATCH

Summary: Finds a Search item in a sequence, and returns its position (starting
from 1).

Syntax: MATCH( Scalar Search ; Reference|Array SearchRegion [ ; Integer
MatchType = 1 ] )

Returns: Any

Constraints: -1 <= MatchType <= 1; The searched portion of SearchRegion shall
not include Logical values. Evaluators may evaluate expressions that do not
meet the constraint that the searched portion of a SearchRegion not include
Logical values.

SearchRegion shall be a vector (a single row or column)

Semantics:

    ●MatchType = -1 finds the smallest value that is greater than or equal to
Search in a SearchRegion where values are sorted in descending order. From a
sequence of identical values >= Search the last value is taken. If no value >=
Search exists, the #N/A Error is returned. If Search is of type Number and the
value found is of type Text, the #N/A Error is returned. 

    ●MatchType = 0 finds the first value that is equal to Search. Values in
SearchRegion do not need to be sorted. If no value equal to Search exists, the
#N/A Error is returned. 

    ●MatchType = 1 or omitted finds the largest value that is less than or
equal to Search in a SearchRegion where values are sorted in ascending order.
>From a sequence of identical values <= Search the last value is taken. If no
value <= Search exists, the #N/A Error is returned. If Search is of type Text
and the value found is of type Number, the #N/A Error is returned. 

If a match is found, MATCH returns the relative position (starting from 1). For
Text the comparison is case-insensitive. MatchType determines the type of
search; if MatchType is 0, the SearchRegion shall be considered unsorted, and
the first match is returned. If MatchType is 1, the SearchRegion may be assumed
to be sorted in ascending order, with smaller Numbers before larger ones,
smaller Text values before larger ones (e.g., "A" before "B", and "B" before
"BA"), and False before True. If the types are mixed, Numbers are sorted before
Text, and Text before Logicals; evaluators without a separate Logical type may
include a Logical as a Number. If MatchType is -1, then SearchRegion may be
assumed to be sorted in descending order (the opposite of the above). If
MatchType is 1 or -1, evaluators may use binary search or other techniques so
that they do not need to examine every value in linear order. MatchType
defaults to 1.

The values returned may vary depending upon the HOST-USE-REGULAR-EXPRESSIONS or
HOST-USE-WILDCARDS or HOST-SEARCH-CRITERIA-MUST-APPLY-TO-WHOLE-CELL properties.
3.4
"

-- 
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/20191129/d6cd4b96/attachment.html>


More information about the Libreoffice-bugs mailing list