Syntax
=LET(name1, value1, calculation, ...)Arguments
| Argument | Required | Description |
|---|---|---|
name1 | Required | A name for the first value |
value1 | Required | The value |
calculation | Required | The final calculation that uses the names |
How to use LET
LET takes 3 required arguments, and accepts more values in the same pattern. Type =LET( in a cell and SheetsBat shows the arguments as you go. Optional arguments are shown in square brackets; leave them out to use their default.
Examples
Each result below was calculated by the SheetsBat formula engine.
=LET(x, 5, y, 2, x*y)Result =LET(x, 3, x^2+1)Result Related logical functions
- IFERRORReturns a value of your choice when a formula gives an error, otherwise the formula result.
- IFNAReturns a value of your choice when a formula gives #N/A, otherwise the formula result.
- IFSChecks conditions in order and returns the value of the first one that is TRUE.
- LAMBDACreates a reusable function with parameters. Call it right away, store it in a name or pass it to MAP, REDUCE and friends.
- NOTReverses a logical value.
- ORTRUE when any argument is TRUE.
- SWITCHCompares a value with a list of cases and returns the result of the first match, or a default.
- TRUEThe logical value TRUE.
- XORTRUE when an odd number of arguments are TRUE.