⌨ Syntax
LET(name1,name_value1,calculation_or_name2,[name_value2,calculation_or_name3...])
Arguments
name1
(required)
— The first name to assign. Must start with a letter. Cannot be the output of a formula or conflict with range syntax.
name_value1
(required)
— The value that is assigned to name1.
calculation_or_name2
(required)
— 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_value2
(optional)
— The value that is assigned to calculation_or_name2.
calculation_or_name3
(optional)
— 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.
▶ Examples
=LET(filterCriteria,"Fred",filteredRange,FILTER(A2:D8,A2:A8= filterCriteria),IF(ISBLANK(filteredRange),"-",filteredRange))
=LET(x,5,SUM(x,1))
=LET(name1,name_value1,calculation_or_name2,[name_value2,calculation_or_name3...])