formulastreak

Logic and errors function

LET function in Google Sheets and Excel

LET gives names to parts of a formula, so each part is calculated once and the formula reads clearly.

Checked against Microsoft's and Google's documentation on · Example calculated on a live sheet

Syntax

LET(name1, name_value1, calculation_or_name2, [name_value2, calculation_or_name3], …)

Arguments in [brackets] are optional. Google Sheets writes it LET(name1, value_expression1, [name2, …], [value_expression2, …], formula_expression ).

Example

=LET(total,F2*G2,tax,total*$L$1,total+tax) reads: Call the order total F2*G2 total, call 8% of it (the rate in L1) tax, and return total + tax.

Leaf & Loam orders · edit I2 and watch it recalculate
Click a cell (or use the arrow keys) to insert its address · Enter shows the resultI2 = $36.72
ABCDEFGHIJKL
1OrderDateCustomerProductCategoryQtyPriceStatusWith taxTax rate8%
210012 Mar 2026Mara OkaforMonsteraPlants1$34.00Shipped$36.72
310022 Mar 2026Jonas LindTerracotta potPots3$12.50Shipped$40.50
410033 Mar 2026Priya RamanSnake plantPlants2$22.00Shipped$47.52
510044 Mar 2026Tomás RuizWatering canTools1$18.00Pending$19.44
610055 Mar 2026Elif DemirFernPlants4$9.50Shipped$41.04
710065 Mar 2026Mara OkaforPotting mixSoil2$7.25Returned$15.66
810076 Mar 2026Kenji MoriPruning shearsTools1$24.00Shipped$25.92
910087 Mar 2026Ines VargaCeramic potPots2$19.00Pending$41.04
1010098 Mar 2026Jonas LindMonsteraPlants1$34.00Shipped$36.72
1110109 Mar 2026Sofia RossiFernPlants6$9.50Shipped$61.56
12101110 Mar 2026Priya RamanPotting mixSoil5$7.25Shipped$39.15
13101211 Mar 2026Leo BrandtSnake plantPlants1$22.00Pending$23.76

I2 shows $36.72: total is 1 × $34, tax is 8% of it, and total + tax is $36.72.

How the spreadsheet calculates it

Names parts of the formula (TOTAL = F2 times G2; TAX = TOTAL times $L$1), then works out TOTAL plus TAX.

  1. 1. LET: Names parts of the formula (TOTAL = F2 times G2; TAX = TOTAL times $L$1), then works out TOTAL plus TAX.
    • name = `TOTAL`: a word for the value
    • value = `F2*G2`: what the name stands for. Add more name/value pairs as needed
    • calculation = `TAX`: the final formula, using the names
    • value2 = `TOTAL*$L$1`: what the name stands for. Add more name/value pairs as needed
    • … = `TOTAL+TAX`:

More LET examples

  • =LET(total,F2*G2,IF(total>=50,total,total+4.95))Free shipping over 50: the total is calculated once.
  • =LET(total,F2*G2,tax,total*$L$1,total+tax)Total plus tax, each named.
  • =LET(x,XLOOKUP(A2,$G$2:$G$8,$I$2:$I$8),IF(x>20,"High","Low"))A lookup used once, tested by name.

Paste any of these into the formula explainer to see it step by step.

Tips

  • Pick names that say what the value is (total, tax, rate) and can't be mistaken for a cell address.
  • Name anything you use twice; it's calculated once.
  • Build a long LET up one name at a time and check the result after each step.
  • Keep settings like rates in cells and name the cell reference inside LET, so the formula reads clearly and the rate stays editable.

What LET is used for

Tidying long formulas in shared models, avoiding repeated lookups or totals inside one formula, and making a formula's logic readable months later.

Arguments

ArgumentRequiredWhat it is
name1YesA name for the first value, such as total. It can't look like a cell address.
name_value1YesThe value or calculation the name stands for.
calculation_or_name2YesEither the final calculation, using the names, or another name.
name_value2, …NoMore name and value pairs; the last argument is always the calculation.

Common mistakes

  • A name that looks like a cell (q3): it's read as a reference.

  • Forgetting the final calculation: LET needs an odd number of arguments.

  • Names that look like cell addresses, such as q3 or tax1.

  • An even number of arguments: LET always ends with the calculation.

In Google Sheets

Google Sheets has LET with the same arguments.

Errors you may see with LET

  • #NAME?: A name is misspelled in the calculation, or the file is open in Excel 2019 or older.

Questions

Does LET make formulas faster?

When a part is used more than once, LET calculates it once instead of every time it appears.

Which versions have LET?

Excel 2021, Excel 2024, Microsoft 365 and Google Sheets. See the LET guide.

Can LET names be used in other cells?

No, they exist only inside that formula. For a name the whole workbook can use, define it in the Name Manager (or Named ranges in Google Sheets).

Sources

Official documentation the facts on this page were checked against.

Practise LET on a live sheet

Lesson 41, LET (Unit 12, LET and LAMBDA), has 5 graded exercises, checked instantly, with steps and hints when you're stuck. Pro