Can the new let() function be used inside a named expression (named range formula)?

For example, if I set a Named Expression as:

LET(x,17,A2+B1)

It results in #NULL! error message in the cell.

Example file (hope it works for you):

named_formula_example_just_1_plus_w_let.ods (12,9 KB)

Works for me with…

2025-04-12 09 01 20

My version was (PortableApps):

Version: 24.8.5.2 (x86) / LibreOffice Community
Build ID: fddf2685c70b461e7832239a0162a77216259f22
CPU threads: 8; OS: Windows 10 X86_64 (10.0 build 19044); UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded

The newest PortableApps.com version is 25.2.1 as of 04/14/2025 (Date Updated: 2025-03-21):
LibreOffice Portable Fresh | PortableApps.com

just like me
screenPiC_LO-version_103027

I cannot see any point in the operation with =LET().

Then you should change the LO version.

25.2.2.2

Well, it’s just a test.

=LET(x,17,A2+B1+x)

But you can imagine a longer equation where it’s helpful to declare some variables that are used up front. EG:

=LET(x,a2,min,5,if(x>min,x,min))

I upgraded to the latest PortableApps version and I still get the #NULL! error.

Version: 25.2.1.2 (x86) / LibreOffice Community
Build ID: d3abf4aee5fd705e4a92bba33a32f40bc4e56f49
CPU threads: 8; OS: Windows 10 X86_64 (10.0 build 19044); UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded

Yet it’s fixed in 25.2.2.2…?

A search of the release notes:

https://wiki.documentfoundation.org/ReleaseNotes/25.2

https://wiki.documentfoundation.org/Releases/25.2.2/RC1#List_of_fixed_bugs

https://wiki.documentfoundation.org/Releases/25.2.2/RC2#List_of_fixed_bugs

Does not turn up anything obvious.

Closest appears to be: 164997 – IFERROR(LET(...)...) gives error for non-error LET result

It was fixed in 25.2.2.2. That bug details that

=IFERROR(LET(a_1;1;a_1);"ERROR")

Results in "ERROR" meaning the LET() is causing an error. Could be the same root cause as OP. Maybe the error does not only appear in Named Expressions.

Here’s a file containing that IFERROR LET test as well:
named_formula_example_just_1_plus_w_let_2.ods (15.7 KB)

PortableApps

says
“LibreOffice Fresh 25.2.2 (John building…)”

you may cross post in bugzilla,
or make your own check with QA/Bibisect - The Document Foundation Wiki