At its core, LET makes it possible to assign names to values, which can be used in calculations that appear to the right in the same formula.
The best way to demonstrate this is with an example:
The formula above first multiplies the values of the Width and Height fields together and assigns the name Area to the resulting value. It then multiplies this value by 1500, assigning it the name Cost. Finally, it adds 1000 to the Cost value and returns the sum.
LET is primarily useful when you need to repeat formula fragments in a formula, allowing you to assign a single name to the repeating part and then refer back to it. That can make formulas shorter and make apps perform better, as it gives Calcapp less work to do.
LET is also useful when you want your formulas to be self-documenting, so that other people can more easily determine how they work.
LET in Microsoft Excel
Being able to use
:= is a Calcapp
extension, which we think makes formulas easier to read. You can use
,; instead of
:= if you like. This
may be useful if you copy and paste formulas between Excel and
LET and arrays
The values you use with LET can be of any type, including arrays. This formula returns the array elements that are greater than 3:
The version without LET would involve repeating the array:
You can also filter an array without repeating it, and without using LET, using a feature specific to Calcapp:
Be sure to check out our full documentation for more on LET, including lots of formula samples.