# LET in Google Sheets: syntax and examples

URL: https://goingstellar.ro/reference/sheets/let/

LET assigns names to values or formulas and then evaluates a final formula that uses those names. A long expression is written once and read by name, which makes big formulas shorter and easier to follow.

## Syntax

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

## Arguments

- `name1` (name, required: yes): A name you choose, such as total. It cannot look like a cell reference.
- `value_expression1` (any, required: yes): The value or formula stored under name1. It is calculated once.
- `name2, value_expression2` (any, required: no): More name and value pairs. Later pairs can use earlier names.
- `formula_expression` (any, required: yes): The last argument: the formula that uses the names and gives the result.

## Examples

The examples use this table, starting in A1:

| Item | Qty | Unit |
|---|---|---|
| Lamp | 3 | 20 |
| Chair | 2 | 50 |
| Desk | 1 | 120 |

```
=LET(x, 5, x*2)
```

Result: `10`

Give a value a name and use it in the formula. Run in a Google Sheet (English US locale) on 2026-11-29.

```
=LET(q, B2, p, C2, q*p)
```

Result: `60`

Two names, then a formula: quantity times unit value for one row. Run in a Google Sheet (English US locale) on 2026-11-29.

```
=LET(t, SUMPRODUCT(B2:B4, C2:C4), t - t/10)
```

Result: `252`

The total is named once and used twice. Run in a Google Sheet (English US locale) on 2026-11-29.

```
=LET(r, C2:C4, MAX(r) - MIN(r))
```

Result: `100`

A name can hold a whole range. Run in a Google Sheet (English US locale) on 2026-11-29.

```
=LET(s, "Hello", UPPER(s) & " " & LOWER(s))
```

Result: `HELLO hello`

Names work with text too. Run in a Google Sheet (English US locale) on 2026-11-29.

## Common errors

- The last argument must be the result formula. LET(x, 1) with no final expression returns #N/A.
- A name cannot look like a cell reference. LET(A1, 5, A1) returns #NAME?.
- Names exist only inside the LET call. Using x after the closing parenthesis returns #NAME?.
- A name that was never defined in the pairs, used in the final formula, returns #NAME?.

## Compared with Excel

Same syntax in Excel.

## Related functions

- [LAMBDA](https://goingstellar.ro/reference/sheets/lambda/)
- [MAP](https://goingstellar.ro/reference/sheets/map/)
- [IFS](https://goingstellar.ro/reference/sheets/ifs/)
- [IF](https://goingstellar.ro/reference/sheets/if/)
- [IFERROR](https://goingstellar.ro/reference/sheets/iferror/)
- [SUMPRODUCT](https://goingstellar.ro/reference/sheets/sumproduct/)

## Sources

- [LET (Docs Editors Help)](https://support.google.com/docs/answer/13190535)

