LET function in Excel
Assigns names to calculation results
=LET(name1, name_value1, calculation_or_name2, [name_value2, calculation_or_name3...])LET syntax and parameters
Five arguments, three required.
- name1stringRequired
The first name to assign. Must start with a letter. Cannot be the output of a formula or conflict with range syntax.
- name_value1anyRequired
The value that is assigned to name1.
- calculation_or_name2anyRequired
One of the following:A calculation that uses all names within the LET function. This must be the last argument in the LET function.A second name to assign to a second name_value. If a name is specified, name_value2 and calculation_or_name3 become required.
- name_value2anyOptional
The value that is assigned to calculation_or_name2.
- calculation_or_name3anyRepeating
One of the following:A calculation that uses all names within the LET function. The last argument in the LET function must be a calculation.A third name to assign to a third name_value. If a name is specified, name_value3 and calculation_or_name4 become required.
LET examples
Formulas you'll actually reuse.
Name the tax rate once instead of repeating it four times:
=LET(tax, 0.19, net, B2, gross, net * (1 + tax), TEXT(gross, "$#,##0.00") & " incl. VAT" )Result
"$118.99 incl. VAT"Reuse an expensive calculation — outliers above 2σ, computed once:
=LET(range, B2:B13, avg, AVERAGE(range), sd, STDEV(range), COUNTIF(range, ">" & (avg + 2 * sd)) )Result
2
LET in Google Sheets
Same name — your formula ports as-is.
Try LET in the playground
Edit the example — nothing to install.
Preloaded with the LET formula from Example 1 — change anything and watch it respond.
LET errors
What they mean — and the fixes.
#NAME?A value expression references a name defined after it — LET only sees names declared earlier in the argument list.
Related functions
More ways Excel gets this done.
- ANDReturns TRUE if all of its arguments are TRUELogicalGoogle Sheets
- BYCOLApplies a LAMBDA to each column and returns an array of the resultsLogicalGoogle Sheets
- BYROWApplies a LAMBDA to each row and returns an array of the resultsLogicalGoogle Sheets
- FALSEReturns the logical value FALSELogicalGoogle Sheets
- IFSpecifies a logical test to performLogicalGoogle Sheets
- IFERRORReturns a value you specify if a formula evaluates to an error; otherwise, returns the result of the formulaLogicalGoogle Sheets