Skip to content
Google Sheets

LET function in Google Sheets

Assigns name with the value_expression results and returns the result of the formula_expression. The formula_expression can use the names defined in the scope of the LET function. The value_expressions are evaluated only once in the LET function even if the following value_expressions or the formula_expression use them multiple times.

=LET(name1, value_expression1, [name2, …], [value_expression2, …], formula_expression )

LET syntax and parameters

Five arguments, three required.

  • name1stringRequired

    A name used inside the next value_expressions and the formula_expression. This must be an identifier (details below), and usage is case-insensitive.

  • value_expression1anyRequired

    Formula whose result can be referred to later with the name that was declared before. It can use names declared in the previous parameters. For example, AVERAGE(B2:D2).

  • name2stringRepeating

    [ OPTIONAL ] Repeatable, additional names to be assigned.

  • value_expression2anyRepeating

    [ OPTIONAL ] Repeatable, additional value_expressions to be evaluated.

  • formula_expressionanyRequired

    Formula to be calculated. It uses names declared in the LET function.

LET examples

Formulas you'll actually reuse.

  1. 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"

  2. Reuse an expensive calculation — outliers above 2σ, computed once:

    =LET(range, B2:B13,
      avg, AVERAGE(range),
      sd, STDEV(range),
      COUNTIF(range, ">" & (avg + 2 * sd))
    )

    Result2

LET in Excel

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.

Loading the editor…

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.