Bug 167582 - lookup with cross-reference
Summary: lookup with cross-reference
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
25.2.5.2 release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Regina Henschel
URL:
Whiteboard: target:26.2.0 target:25.8.1 target:25...
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2025-07-18 16:50 UTC by maci
Modified: 2025-08-08 10:58 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
a.ods file with table; file b.ods cross-reference (18.26 KB, application/x-zip-compressed)
2025-07-18 16:50 UTC, maci
Details
Tests with LOOKUP with external lookup and result vector (22.09 KB, application/x-zip-compressed)
2025-07-24 22:24 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description maci 2025-07-18 16:50:06 UTC
Created attachment 201881 [details]
a.ods file with table; file b.ods cross-reference

I have a table (file a.ods) with a date in the first column and other data in the second column. 
Lookup works fine in the same sheet (1)  or other sheet (2) of same file.
If Lookup is in other file (b.ods) I get an error. 
Until  rel 25.2.4 it was fine.
Comment 1 Regina Henschel 2025-07-18 20:17:59 UTC
(In reply to maci from comment #0)
> Created attachment 201881 [details]
> a.ods file with table; file b.ods cross-reference
> 
> I have a table (file a.ods) with a date in the first column and other data
> in the second column. 
> Lookup works fine in the same sheet (1)  or other sheet (2) of same file.
> If Lookup is in other file (b.ods) I get an error. 
> Until  rel 25.2.4 it was fine.

What error do you get?
Comment 2 maci 2025-07-18 20:26:11 UTC
#n/a
(#n/d italiano version)
Comment 3 maci 2025-07-19 09:19:40 UTC
error is #n/a (#n/d italian version)
I wrote "cross-reference" instead of "external reference"
Comment 4 nobu 2025-07-24 02:34:06 UTC
The documentation provided is simple and straightforward.

Version 24.8.7.2 returns the expected value of 74, but more recent versions return #N/A.

Not reproduced with
Version: 24.8.7.2 (X86_64) / LibreOffice Community
Build ID: e07d0a63a46349d29051da79b1fde8160bab2a89
CPU threads: 4; OS: Windows 10 X86_64 (10.0 build 19045); UI render: Skia/Vulkan; VCL: win
Locale: en-US (ja_JP); UI: en-US
Calc: threaded

Reproducible with
Version: 25.2.5.2 (X86_64) / LibreOffice Community
Build ID: 03d19516eb2e1dd5d4ccd751a0d6f35f35e08022
CPU threads: 4; OS: Windows 10 X86_64 (10.0 build 19045); UI render: Skia/Raster; VCL: win
Locale: en-US (ja_JP); UI: en-US
Calc: CL threaded

Reproducible with
[2025-07-23]
Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 7f4868348c14b305fcd75744e1e3544d0d3a5d61
CPU threads: 4; OS: Windows 10 X86_64 (build 19045); UI render: Skia/Raster; VCL: win
Locale: en-US (ja_JP); UI: en-US
Calc: CL threaded
Comment 5 nobu 2025-07-24 03:48:05 UTC
The Function Wizard also confirms that the second and third parameter references are working correctly, but they do not seem to return the correct values.
Comment 6 Saburo 2025-07-24 06:16:59 UTC
bibisected with win64-26.2

commit 5c0961129820fbc9dc8ec12c8a43a352ef1856a3
author	Regina Henschel

tdf#167134 Allow different directions in LOOKUP
Comment 7 Regina Henschel 2025-07-24 22:24:26 UTC
Created attachment 201982 [details]
Tests with LOOKUP with external lookup and result vector

Error was, that setting the correct dimension for the result vector was only done for inline arrays. Proposed fix is in https://gerrit.libreoffice.org/c/core/+/188304

External references need the same changes as inline arrays. The LOOKUP result has been wrong in case lookup vector and result vector have different orientations. Only that this is so unusual for external references, that it was not detected. The attached documents contain test cases for that, so that you can see, that it was indeed wrong in LO 24.8.
Comment 8 Commit Notification 2025-08-07 14:26:12 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/52bdf18342db5b05a9f0ec17904a55cebe553a5a

tdf#167582 consider orientation of external lookup source

It will be available in 26.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2025-08-07 17:53:06 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "libreoffice-25-8":

https://git.libreoffice.org/core/commit/4c85f87fb528ace3db87bd79977d7397bc91e6eb

tdf#167582 consider orientation of external lookup source

It will be available in 25.8.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Commit Notification 2025-08-07 20:31:47 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "libreoffice-25-2":

https://git.libreoffice.org/core/commit/67684fab6edace39348e6de3b37a9fc7d82b103c

tdf#167582 consider orientation of external lookup source

It will be available in 25.2.6.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 11 Commit Notification 2025-08-08 10:58:07 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "libreoffice-25-8-0":

https://git.libreoffice.org/core/commit/55e680bfb98be1c8780788a75f1da929c24e5f5b

tdf#167582 consider orientation of external lookup source

It will be available in 25.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.