Does Calc have a function similar to LET()?

Microsoft Excel has a =LET() function, which from my understanding allows one to assign names to variables. One use case is avoiding lengthy repetition within a formula. Does LibreOffice Calc have a similar function?

try
https://help.libreoffice.org/6.4/en-US/text/sbasic/shared/01020100.html?DbPAR=BASIC
https://help.libreoffice.org/3.3/Basic/Using_Variables

Thanks, @AdmFubar. Iā€™ll certainly look into it, though Iā€™m not too familiar with LibreOffice Basic. I was also hoping to find an in-cell function or formula.

Those actually interested may visit http://psilosoph.de/FreeOfficeRequests/.
They will find an explaining text there, and a nearly 4 years old partial and provisional solution (which actually worked in examples).

Years later I was lead back here by a special notice and found the link broken.

Once more emphasizing that the suggested ā€œsolutionā€ was just an experimetal proof of concept, I upload here the relevant example from the broken link and a short related plain text:
KeepInMemory0.1.ods (20.0 KB)
toAfewContributors.odt (2.6 KB)
Concerning the ā€œbackstage memoryā€ I would now prefer a different approach but due to age Iā€™m not confident there will be ā€˜private developmentā€™ in that direction by myself.

Below the next to unchanged part of the old post.

Recently I reconsidered the topic superficially. However, there are some facts not making me fond of expending much time on this. Mainly:

  1. Next to nobody seems to need it.
  2. The provisional solution is too fainthearted.
  3. The gain in efficiency may be minimal, partly due to the usage of Basic, partly to the fact that the efficiency of expensive calculations was improved in Calc.
  4. A really adequate usage beyond the most obvious cases may prove to be somehow fragile or error-prone.

There is also a temptation to ā€œrevive the projectā€: The provisional LET() function of Excel365 may be a flop. In specific the second example from the page @erAck linked to is more of an offence than of an offer, imo.
(Donā€™t prematurely start to use my provisional code.)

The advantage it has is that the sub-expression FILTER(A2:D8,A2:A8="Fred") occurs only once and has to be executed/calculated only once, the second occurrence of filteredRange reusing the result of the first occurrence (or at least thatā€™s what Iā€™d hope how itā€™s implementedā€¦) which may make a difference in large range calculations.

Yes, of course. Did you glance through my provisional ā€œimplementationā€: I would prefer to not rule the feature by a function like LET() disposing the helper variable autoamtically on leave, but by a couple of functions applicable much more flexible.

I edited my main comment above.

No, LET() is not implemented.

(for the curious: MS365 beta feature LET function - Office Support)

1 Like

Appreciate it, @erAck.

Hereā€™s the bug tracking this feature request:

https://bugs.documentfoundation.org/show_bug.cgi?id=137543