LET Function in Google Sheets
Assigns names to expressions and reuses them within a single formula. Makes complex formulas vastly more readable and faster — repeated subexpressions are computed only once.
Syntax
LET(name1, value1, [name2, value2, ...], formula)Returns: The result of formula with all names resolved.
Excel equivalent: LET (identical, requires Excel 2021+ or Microsoft 365)
Introduced: 2022
Parameters
| Name | Required | Description |
|---|---|---|
| name1, name2, ... | Required | Variable names to introduce. |
| value1, value2, ... | Required | Expressions to bind to each name. |
| formula | Required | The final expression that uses the names. Must be the last argument. |
Examples
Avoid repeating a subexpression
=LET(total, SUM(A2:A100), avg, total/COUNT(A2:A100), avg * 1.2)Computes SUM once, COUNT once, reuses them. Cleaner than =SUM(A:A)/COUNT(A:A) * 1.2 written inline.
Readable conditional logic
=LET(score, B2, IF(score >= 90, "A", IF(score >= 80, "B", IF(score >= 70, "C", "F"))))Names B2 as 'score' so the formula reads like English. The compiler still optimizes — no performance cost.
Multi-step calculation
=LET(price, B2, tax_rate, 0.0875, subtotal, price * 0.9, tax, subtotal * tax_rate, subtotal + tax)Each name can reference earlier names. Reads top-to-bottom like a normal program.
When to use an alternative
- Helper columns — The intermediate values are useful to see, not just internal.
- LAMBDA — You want to define a reusable function, not just a one-shot calculation.
- Named ranges — The same value is reused across many formulas.
Common errors and how to fix them
Last argument missing
Cause: Pairs of name/value but no final formula.
Fix: Always end LET with the result expression: LET(x, 5, y, 10, x + y) — the x+y is mandatory.
Name collision with built-in
Cause: Used SUM, IF, or other function name as a variable.
Fix: Pick descriptive names: total instead of sum, condition instead of if.
Related functions
Frequently Asked Questions
When should I use LET?
Whenever you find yourself repeating the same subexpression twice in a formula, or whenever a formula is so long that adding names would help readability. LET is one of the highest-leverage modern additions to Sheets.
Does LET slow down the formula?
No — quite the opposite. Each name is computed once and reused. Without LET, repeated calls to the same expression each recompute. LET makes complex formulas faster, not slower.