LET
Assigns names to calculation results to improve readability and performance.
LET(name1, value1, [name2, value2], ..., calculation)Arguments
name1Variable namevalue1Value for the variablecalculationFinal formula using the variables
=LET(x,A1*2,x+x^2)Calculates A1*2 once
=LET(total,SUM(A:A),avg,total/COUNT(A:A),IF(avg>100,"High","Low"))Named intermediate values
=LET(r,FILTER(A:A,B:B>0),SUM(r)/COUNT(r))Filter once, use twice
- •Avoids recalculating the same expression
- •Makes complex formulas readable
- •Excel 365 and 2021 only
- •Forgetting that LET requires an even final structure - each named variable must be paired with its value expression, and the very last argument must always be the calculation that uses those names
- •Trying to reference a name before it's been defined earlier in the same LET statement - names can only reference names that came before them, not ones defined later in the sequence
- •Using LET in a version of Excel that doesn't support it (anything before Excel 2021 / Microsoft 365), where the function simply doesn't exist
LAMBDAOften combined with LET to define reusable custom functions that also benefit from LET's readable, named intermediate calculations.IFFrequently nested inside LET when a named intermediate value needs conditional logic applied to it.XLOOKUPA common candidate to wrap in LET when the same lookup result needs to be reused several times within one formula without repeating the entire lookup.Why does LET give a syntax error?
LET requires pairs of name and value, followed by one final calculation - if the count doesn't work out evenly, or the last argument is missing, Excel flags it as invalid.
Can a name defined in LET reference another name from the same LET?
Yes, but only names defined earlier in the sequence - a name can't reference one that comes after it.
What's the main benefit of using LET?
It lets you calculate a value once, give it a readable name, and reuse it multiple times in the same formula, instead of repeating (and potentially recalculating) the same complex expression over and over.
Need to translate a formula using LET?
Use our translator to convert your complete formula
