toolrota

Excel LET function explained: shorten long formulas by defining variables

Writing the same calculation many times makes formulas long and slow. LET lets you name intermediate results for readable, faster formulas.

Serkan Akyürek··3 min read
Excel LET function explained: shorten long formulas by defining variables – Excel

Have you ever typed the same calculation several times in a long Excel formula? The LET function lets you give an intermediate result a name and use that name in the rest of the formula. The formula gets shorter, easier to read, and Excel stops repeating the same work. It is available in Microsoft 365 and Excel 2021 and later.

Syntax

LET(name1, value1, [name2, value2], ..., calculation)

The last argument is the real calculation that uses the names you defined. You can add as many name and value pairs as you like.

Why use it?

  • Readability: names like "sales" and "cost" are clearer than cell references.
  • Speed: if the same VLOOKUP or FILTER result is needed in several places, it is calculated once.
  • Maintenance: to change a value you only touch one place in the formula.

Example

To calculate profit margin, bind sales and cost to separate names: define the sales total first, then the cost total, and in the last step calculate (sales - cost) / sales. Instead of writing the same total three times, two names are enough.

Steps for writing a LET formula
  1. 1

    Identify the repeated calculations

  2. 2

    Pick a short name for each

  3. 3

    Write the name and value pairs in order

  4. 4

    Put the real calculation in the last argument

  5. 5

    Compare the result with the old formula

LET versus Name Manager

FeatureLETName Manager
ScopeOnly that formulaWhole workbook
UseFor intermediate calculationsFor constants and ranges
VisibilityInside the formulaIn a separate list

For the Name Manager see our Excel name manager guide.

Tips

  • Choose meaningful names: use sales and cost rather than x and y.
  • Start small: try one name first, then expand.
  • Combine with dynamic arrays: bind FILTER and SORT results to a name and reuse them.

Common mistakes

  1. Leaving name and value pairs incomplete. The last argument must be a calculation.
  2. Choosing a name that looks like a cell reference, such as A1.
  3. Using a name before defining it. Order matters.
  4. Sharing with people on older versions. The formula returns an error.

Frequently asked questions

Does LET slow formulas down? No, it mostly speeds them up.

How many names can I define? As many as you need in practice; the limit is very high.

Summary

LET makes long formulas short, fast and readable. Start by naming your repeated calculations.

Share
Published:
Author
Serkan Akyürek

Serkan Akyürek is the founder and author of toolrota; he writes step-by-step guides on Excel, AI, the cloud, personal finance and digital security.