Description: If you try to connect areas with each other using INDEX(), you will receive an error when using names defined in LET(). Steps to Reproduce: With the INDEX function, I can use the following formula =INDEX((A2:A4~C2:C4~E2:E4),MOD(SEQUENCE(9,1,0),3)+1,0,INT(SEQUENCE(9,1,0)/3)+1) to create a matrix that writes all three ranges one below the other. First the range 1 then 2 and then 3. The ranges are connected in Index with the tilde. If you now try to define these three ranges in advance and assign them to a name with LET(), this no longer works with the names in INDEX(). =LET(a,A2:A4,b,C2:C4,c,E2:E4,INDEX((a~b~c),MOD(SEQUENCE(9,1,0),3)+1,0,INT(SEQUENCE(9,1,0)/3)+1)) results in Error 502. In Excel, this also works with the names defined in LET(). In Excel there is the function VSTACK() which performs the same task. Actual Results: Error 502 Expected Results: my three ranges Reproducible: Always User Profile Reset: No Additional Info: Version: 24.8.0.0.alpha1+ (X86_64) / LibreOffice Community Build ID: 6d39b1a6068bbbd5ca4947f668f989dbfb73342d CPU threads: 8; OS: Windows 11 X86_64 (10.0 build 22631); UI render: Skia/Vulkan; VCL: win Locale: en-GB (de_DE); UI: en-GB Calc: threaded
Created attachment 194632 [details] Sample document The bug can be seen in this document
FWIW, Error 502 means "IllegalArgument", Invalid argument.
Balazs Varga committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/5c9040c16506d5ef2708416ea280d97b707092b4 tdf#161496 - Fix single ocPush tokens in LET function Name values 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.