# 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?

edit retag close merge delete

( 2020-10-16 17:21:34 +0200 )edit

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.

( 2020-10-16 17:28:41 +0200 )edit

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).
Recently I reconsidered the topic superficially. However, ther 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 to fainthearted.
-3- The gain in efficiency may be minimal, partly due to the usage of Basic, partly to the fact that the effivciency 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 ...(more)

( 2020-10-22 16:18:47 +0200 )edit

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.

( 2020-10-22 19:27:23 +0200 )edit

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.

( 2020-10-22 20:42:08 +0200 )edit

Sort by » oldest newest most voted

No, LET() is not implemented.

(for the curious: MS365 beta feature https://support.microsoft.com/en-us/o...)

more