LET Function in Google Sheets

LET gives a name to a value or calculation inside one formula. You can reuse that name later, which makes repeated logic shorter and easier to read.

For three ratings in B2:D2, this formula calculates the average once and stores it as avgscore.

Simplify a Repeated Calculation With LET

Enter 3.5, 4, and 3 in B2:D2, under three rating headers.

=LET(avgscore,AVERAGE(B2:D2),IF(avgscore>=4,"Great",IF(avgscore>=3,"Good","Poor")))

The tested ratings were 3.5, 4, and 3. The formula returned Good.

LET names and reuses the average score, returning Good for scores 3.5, 4, and 3.

Without LET, the formula would repeat AVERAGE(B2:D2) in both comparisons. LET makes the calculation’s purpose visible and avoids repeating it.

LET Function Syntax

=LET(name1,value_expression1,[name2,value_expression2,...],formula_expression)
  • name1 is the identifier used later in the formula.
  • value_expression1 calculates the value assigned to that name.
  • formula_expression returns the final result.

You can add more name and value pairs before the final expression.

Use Valid LET Names

Names cannot look like cell references, contain spaces or special characters, or begin with a number.

In the live test, =LET(A1,5,A1*2) returned #NAME? because A1 is a cell reference.

The formula =LET(9score,5,9score*2) returned #ERROR! because the name begins with a number.

Name usage is case-insensitive. The tested formula =LET(Total,5,total*2) returned 10.

Build a Formula in Left-to-Right Steps

A later value expression can use a name declared earlier. This lets you write a calculation as a short sequence.

=LET(x,2,y,x+3,y*2)

Sheets assigned 2 to x, calculated y as 5, then returned 10. The tested output matched that sequence.

Reuse a Lookup Result

LET is useful when the same lookup result drives several parts of a final expression.

For a reproducible example, enter these records in H1:J4 and put P02 in L2:

Product IDProductPrice
P01Pen80
P02Folder120
P03Paper40
=LET(price,VLOOKUP(L2,H2:J4,3,FALSE),IF(price>100,"High: "&price,"Standard: "&price))

The VLOOKUP appears once. The final IF can use price for both the comparison and displayed result.

LET Evaluates a Named Expression Once

Google states that each value expression evaluates once, even when its name appears several times later.

This behavior was checked with a volatile value:

=LET(sample,RAND(),sample=sample)

The formula returned TRUE because both uses referred to the same stored evaluation.

This guarantee can avoid repeated work inside one formula. It does not prove a specific speed improvement for every spreadsheet.

See Google’s LET reference for identifier rules, scope, and official examples.

Other Google Sheets articles you may also like