Bug 99343 - Function MATCH() gives error
Summary: Function MATCH() gives error
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.0.5.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-16 12:16 UTC by checkdizz
Modified: 2016-04-16 12:37 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Example showing the bug (11.90 KB, application/vnd.oasis.opendocument.spreadsheet)
2016-04-16 12:16 UTC, checkdizz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description checkdizz 2016-04-16 12:16:10 UTC
Created attachment 124388 [details]
Example showing the bug

The MATCH() function results in an error when the searched range has specific values. 

In the attached example the function is used in cell B2. It searches range A5:A15 for the value noted in cell B3, using a ascending range. In this example cell B3 shows the highest value in the range A5:A15. The MATCH() function works fine, unless the range in A5:A15 starts below 99 AND contains the value 100. 

For example if the range values add up from 81 to 91, the highest value is 91 and the MATCH function correctly finds the corresponding cell. Same goes for a value range from 91 to 99. However when the value 100 is added to the list in column A, the MATCH() function results in #N/B. Strangely this is not connected to the value 100 perse. When the list in column A starts with 99, the function produces a correct result even when the value 100 is also present in the list.

The bug can be avoided by using an exact match instead of an ascending range. This is not always possible of course.
Comment 1 GerardF 2016-04-16 12:37:36 UTC
Because your data in search_range are text value, not numeric one.
So text "100" is < to text "99".
And MATCH fails with lasr argument set to 1 and unsorted searc_range.