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.
- IFSChecks whether one or more conditions are met and returns a value that corresponds to the first TRUE condition.LogicalGoogle Sheets
- LAMBDACreate custom, reusable and call them by a friendly nameLogicalGoogle Sheets
- AVERAGEIFReturns the average (arithmetic mean) of all the cells in a range that meet a given criteriaStatisticalGoogle Sheets
- CELLReturns information about the formatting, location, or contents of a cellThis function is not available in Excel for the web.InfoGoogle Sheets
- CSCReturns the cosecant of an angleMathGoogle Sheets
- FILTERFilters a range of data based on criteria you defineLookupGoogle Sheets