Ask Your Question

Does Calc have a function similar to LET()?

asked 2020-10-16 16:21:43 +0200

vxky33x0egwnf4 gravatar image

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 flag offensive close merge delete


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.

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

Those actually interested may visit
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)

Lupp gravatar imageLupp ( 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.

erAck gravatar imageerAck ( 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.

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

1 Answer

Sort by » oldest newest most voted

answered 2020-10-16 20:28:37 +0200

erAck gravatar image

No, LET() is not implemented.

(for the curious: MS365 beta feature

edit flag offensive delete link more


Appreciate it, @erAck.

vxky33x0egwnf4 gravatar imagevxky33x0egwnf4 ( 2020-10-17 16:20:43 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2020-10-16 16:21:43 +0200

Seen: 42 times

Last updated: Oct 16