Bug 170383 - When the result is in a single cell, LET() formula may not perform array calculations without array-mode (Ctrl+Shift+Enter)
Summary: When the result is in a single cell, LET() formula may not perform array calc...
Status: RESOLVED DUPLICATE of bug 169718
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
25.8.4.2 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-01-19 07:54 UTC by nib70776
Modified: 2026-01-31 14:46 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nib70776 2026-01-19 07:54:43 UTC
Description:
The following gives an error:
=LET( chars,{"A","B"}, upper,FIND(chars,"ABCDEFGHIJKLMNOPQRSTUVWXYZ"), COLUMNS(upper)) .... error Err:504
But these 2 functions work:
=LET( chars,{"A","B"}, upper,FIND({"A","B"},"ABCDEFGHIJKLMNOPQRSTUVWXYZ"), COLUMNS(upper)) .... no error, result 2
=LET( chars,{"A","B"},  upper,FIND(chars,"ABCDEFGHIJKLMNOPQRSTUVWXYZ"), COLUMNS(chars)) .... no error, result 2

Steps to Reproduce:
1. Enter the following function in a cell: =LET( chars,{"A","B"}, upper,FIND(chars,"ABCDEFGHIJKLMNOPQRSTUVWXYZ"), COLUMNS(upper)) 
2. Result: Err:504 instead of 2
3. But the following 2 functions give the correct result of 2:
4. =LET( chars,{"A","B"}, upper,FIND({"A","B"},"ABCDEFGHIJKLMNOPQRSTUVWXYZ"), COLUMNS(upper))
5. =LET( chars,{"A","B"},  upper,FIND(chars,"ABCDEFGHIJKLMNOPQRSTUVWXYZ"), COLUMNS(chars)) 
3.

Actual Results:
see above

Expected Results:
see above


Reproducible: Always


User Profile Reset: No

Additional Info:
no other info
Comment 1 nobu 2026-01-19 08:31:43 UTC
Try
Ctrl + Shift + Enter

*** This bug has been marked as a duplicate of bug 169718 ***
Comment 2 nib70776 2026-01-19 08:35:32 UTC
no change with ctrl+shift+enter
Comment 3 Werner Tietz 2026-01-19 10:11:09 UTC
Cannot reproduce the issue ( in case I enter correctly as array-formula )

apart that the Formula doesnt make any sense…
use:
=COLUMNS(A:B)
Comment 4 nib70776 2026-01-19 11:18:58 UTC
This case is only for testing to show the bug in LET / FIND functions. FIND returns no array if the first argument in FIND is a local variable of LET containing an array.
But if the first argument of FIND is an array constant, e.g. {"A","B"} everything is fine.
Comment 5 nib70776 2026-01-19 11:21:13 UTC
Sorry, I tried once more - now it is working if I press shift+ctrl+enter !!!!
Comment 6 raal 2026-01-21 11:01:01 UTC
(In reply to nib70776 from comment #5)
> Sorry, I tried once more - now it is working if I press shift+ctrl+enter !!!!

Closing.
Comment 7 nobu 2026-01-22 08:52:48 UTC

*** This bug has been marked as a duplicate of bug 169718 ***
Comment 8 nobu 2026-01-25 00:32:51 UTC
When the result is a single cell and a numeric value, the SUMPRODUCT function can sometimes handle the array by avoiding array mode.
This was a well-known method in Excel too. It might be useful if you need interoperability.

SUMPRODUCT
https://help.libreoffice.org/latest/en-US/text/scalc/01/04060107.html?DbPAR=CALC#bm_id3163286
SUMPRODUCT returns a single number, it is not necessary to enter the function as an array function.

The SUMPRODUCT function won't work perfectly in every case, but the sample formula provided displays the correct value.

=SUMPRODUCT(LET(chars,{"A","B"}, upper, FIND(chars, "ABCDEFGHIJKLMNOPQRSTUVWXYZ"), COLUMNS(upper))) --> 2
Comment 9 nobu 2026-01-31 14:46:45 UTC
How should a name be assigned to a range within the Let() function
https://ask.libreoffice.org/t/how-should-a-name-be-assigned-to-a-range-within-the-let-function/130855