Bug 161454 - LET function, round-trip issue with ms sample for the function.
Summary: LET function, round-trip issue with ms sample for the function.
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
24.8.0.0 alpha1+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:24.8.0
Keywords:
Depends on:
Blocks: Excel-Functions
  Show dependency treegraph
 
Reported: 2024-06-07 09:00 UTC by m_a_riosv
Modified: 2024-07-18 09:08 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Test LET function with sample on Excel help. (7.77 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2024-06-07 09:00 UTC, m_a_riosv
Details
LET with array function Export (7.87 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2024-06-10 07:33 UTC, Balázs Varga (allotropia)
Details
Original file reproduced in Excel 21 (10.53 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2024-06-11 07:00 UTC, Gabor Kelemen (allotropia)
Details
My example saved in Calc nightly (7.75 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2024-06-11 07:02 UTC, Gabor Kelemen (allotropia)
Details
The original and the Calc-saved file in Excel 21 (108.38 KB, image/png)
2024-06-11 07:03 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description m_a_riosv 2024-06-07 09:00:38 UTC
Created attachment 194579 [details]
Test LET function with sample on Excel help.

Attached a sample test for LET function, taken from function help in Excel
https://support.microsoft.com/en-au/office/let-function-34842dd8-b92b-4d3f-b325-b8b8f9908999
Sample 2.

Creating the sample in Excel (xlsx), it opens as array in Calc, but saving and opening again in Excel, doesn't work.

Also, there is a different result involving blank cell in source data.
Version: 24.8.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 6d39b1a6068bbbd5ca4947f668f989dbfb73342d
CPU threads: 16; OS: Windows 11 X86_64 (10.0 build 22631); UI render: Skia/Vulkan; VCL: win
Locale: es-ES (es_ES); UI: en-US
Calc: CL threaded

Microsoft® Excel® para Microsoft 365 MSO (versión 2405 compilación 16.0.17628.20006) de 64 bits 

Perhaps the issue is not with LET but the array's manage.
Comment 1 Commit Notification 2024-06-09 22:01:57 UTC
Balazs Varga committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/5a75414d1772d1fd998f405e3b9bd80b1f10c51f

tdf#161454 - Fix new array functions handle empty matrix cells

It will be available in 24.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.
Comment 2 Balázs Varga (allotropia) 2024-06-10 07:32:17 UTC
> https://git.libreoffice.org/core/commit/
> 5a75414d1772d1fd998f405e3b9bd80b1f10c51f

So this patch only related to this issue: "Also, there is a different result involving blank cell in source data."

The other one "Creating the sample in Excel (xlsx), it opens as array in Calc, but saving and opening again in Excel, doesn't work." unfortunatelly, I have no idea atm, checked the xml files and everything looked fine around the let function. Also in case of other inside array function in the LET function it is worked fine in MSO after LO export. Atteched an example document. But I saw some suspecios line in the workbook.xml which were missed from the exported file but not from the original file. May be related to this issue.

<xcalcf:calcFeatures>
                <xcalcf:feature name="microsoft.com:RD" />
                <xcalcf:feature name="microsoft.com:Single" />
                <xcalcf:feature name="microsoft.com:FV" />
                <xcalcf:feature name="microsoft.com:CNMTM" />
                <xcalcf:feature name="microsoft.com:LET_WF" />
                <xcalcf:feature name="microsoft.com:LAMBDA_WF" />
                <xcalcf:feature name="microsoft.com:ARRAYTEXT_WF" />
</xcalcf:calcFeatures>
Comment 3 Balázs Varga (allotropia) 2024-06-10 07:33:10 UTC
Created attachment 194621 [details]
LET with array function Export
Comment 4 m_a_riosv 2024-06-10 13:36:11 UTC
Verified about the empty cell
Version: 24.8.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 5a75414d1772d1fd998f405e3b9bd80b1f10c51f
CPU threads: 16; OS: Windows 11 X86_64 (10.0 build 22631); UI render: Skia/Vulkan; VCL: win
Locale: es-ES (es_ES); UI: en-US
Calc: CL threaded

About the array, in your sample file the function looks like an explicit array, but in Excel if you delete the LET formula and introduce it only with enter, the array is also created but without being an explicit array ({}).
Opening the last in LO it is an explicit array formula.
Saving in LO and opening it in Excel, work with the explicit array.
But I think the issue is LO importing the formula as an explicit array, what it is not in Excel.
Comment 5 Gabor Kelemen (allotropia) 2024-06-11 07:00:25 UTC
Created attachment 194641 [details]
Original file reproduced in Excel 21
Comment 6 Gabor Kelemen (allotropia) 2024-06-11 07:02:48 UTC
Created attachment 194642 [details]
My example saved in Calc nightly

Version: 24.8.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 5a75414d1772d1fd998f405e3b9bd80b1f10c51f
CPU threads: 6; OS: Windows 10 X86_64 (10.0 build 19045); UI render: Skia/Raster; VCL: win
Locale: en-GB (en_GB); UI: en-US
Calc: default

I believe I managed to create a CSE array in the A28 cell, yet it is broken the same way by Calc as the one in A11
Comment 7 Gabor Kelemen (allotropia) 2024-06-11 07:03:37 UTC
Created attachment 194643 [details]
The original and the Calc-saved file in Excel 21