Bug Hunting Session
Bug 60366 - EDITING: MATCH() function fails (err: 504) when parameter 2 (LookupArray) is a single-cell named range
Summary: EDITING: MATCH() function fails (err: 504) when parameter 2 (LookupArray) is ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.6.5.2 release
Hardware: Other Linux (All)
: medium normal
Assignee: Eike Rathke
URL:
Whiteboard: BSA target:4.1.0 target:3.6.6 target:...
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-06 13:33 UTC by francois.felix
Modified: 2013-02-07 10:19 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
ODS that shows the bug as described in "Steps to reproduce" (8.45 KB, application/vnd.oasis.opendocument.spreadsheet)
2013-02-06 13:33 UTC, francois.felix
Details

Note You need to log in before you can comment on or make changes to this bug.
Description francois.felix 2013-02-06 13:33:08 UTC
Created attachment 74289 [details]
ODS that shows the bug as described in "Steps to reproduce"

Problem description: MATCH() function fails (err: 504) when parameter 2 (LookupArray) is a single-cell range


Steps to reproduce:
1. Create a new workbook

2. Create a named range (CTRL+F3) with
* name = "range1" 
* range = "$A$1"
* [other parameters: any]

3. In cell A1, insert character: a

4. In cell B1, insert formula: =MATCH("a";range1)

Current behavior:
Cell B1 shows "Err:504"

Expected behavior:
Cell B1 shows "1"



Additional information:
5. Create a named range (CTRL+F3) with
* name = "range2" 
* range = "$A$1:$A$1"
* [other parameters: any]

6. In cell B2, insert formula "=MATCH("a";range2)"

=> displays "1", as expected

It might be worth noting that:
MATCH("a";A1) => Err:504 (expected: 1)
MATCH("a";A1:A1) => 1 (as expected)

Same behaviour seen on:
- v4.0.0.3 (Build ID: 7545bee9c2a0782548772a21bc84a9dcc583b89
- v3.6.5.2 (Build ID: 5b93205)
- v3.5.4.2 (Version ID 350m1(Build:2))
Operating System: Ubuntu
Version: 3.6.5.2 release
Comment 1 Eike Rathke 2013-02-06 13:37:08 UTC
Taking this.
Comment 2 francois.felix 2013-02-06 14:18:11 UTC
Also, in the same test scenario, insert the following formula to (e.g.) cell B5:

=EQUIV("a";INDIRECT("range2"))
=> Err:504


Although:

=EQUIV("a";range2)
=> "1", as expected

(or is this a problem with INDIRECT() ?)
Comment 3 Eike Rathke 2013-02-06 15:30:28 UTC
What is the EQUIV() function? It's not part of Calc core.

=INDIRECT("range2")  in the above scenario works.
Comment 4 francois.felix 2013-02-06 15:38:57 UTC
Sorry, replace "EQUIV" by "MATCH" in my previous comment.
(EQUIV is the French version of MATCH).
Comment 5 Eike Rathke 2013-02-06 15:45:32 UTC
Ah, I should had noticed.. I'll take a look into that as well.
Comment 6 Eike Rathke 2013-02-06 17:14:26 UTC
Effectively both the same cause, a single cell reference not being accepted.
Comment 7 Not Assigned 2013-02-06 17:18:56 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c0fdab890086c2cb749c348db42eb760e31539de

resolved fdo#60366 make MATCH() accept a single cell reference



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.
Comment 8 Eike Rathke 2013-02-06 17:32:22 UTC
Pending review for 4-0 as https://gerrit.libreoffice.org/2018
and for 3-6 as https://gerrit.libreoffice.org/2019
Comment 9 Not Assigned 2013-02-06 19:34:09 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-3-6":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=b4c78b8480b1cc1e867180fc994f5c5162fa3e42&h=libreoffice-3-6

resolved fdo#60366 make MATCH() accept a single cell reference


It will be available in LibreOffice 3.6.6.

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.
Comment 10 Not Assigned 2013-02-06 19:34:27 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-4-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=e577ebc9403d77fe4847a2e1d55a83d432f214f8&h=libreoffice-4-0

resolved fdo#60366 make MATCH() accept a single cell reference


It will be available in LibreOffice 4.0.1.

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.