LET Function in Excel: Name the Parts of a Formula
By ExcelReady TeamUpdated 6 min read
The short answer
The LET function in Excel gives names to values or calculations inside one formula. You write =LET(name, value, calculation), then use the name instead of repeating the same piece. Excel works out each value once, so long formulas get shorter, easier to read and often faster. LET needs Microsoft 365, Excel 2021 or later.
Key takeaways
- The shape is =LET(name1, value1, [name2, value2, ...], calculation). The last argument is always the result.
- Each value is calculated once, even if its name is used many times, which can speed up heavy formulas.
- Names exist only inside that formula and can't look like a cell address, such as A1 or TAX2026.
- LET pairs well with FILTER: name the filtered list once, then SUM, COUNT or AVERAGE it.
- Older Excel shows #NAME? for LET, so share LET formulas only with Excel 2021 or Microsoft 365 users.
On this page+
The LET function in Excel lets you name the parts of a formula. Instead of repeating the same calculation three times, you name it once, such as total, and use the name wherever you need it. Your formula gets shorter, easier to check and often faster. This guide is for anyone who writes long formulas in Microsoft 365 or Excel 2021 and wants them to read more like plain sentences.
What does the LET function do?#
LET stores a value under a name for the length of one formula. The value can be a number, a range or a whole calculation. The last argument is the calculation that uses those names, and its answer is what the cell shows.
=LET(name1, value1, [name2, value2, ...], calculation)| Part | What it means | Example |
|---|---|---|
| name1 | A name you choose, starting with a letter | rate |
| value1 | What the name stands for | 0.05 or SUM(C2:C8) |
| name2, value2 | Optional extra pairs, up to 126 in total | total, SUM(C2:C8) |
| calculation | The formula that uses the names. Its result is returned | total*rate |
A tiny example: =LET(x, 5, x*2) returns 10. The name x means 5, and the calculation doubles it.
LET is part of the newer set of functions that came with dynamic arrays. It needs Microsoft 365, Excel 2021, Excel 2024 or Excel for the web. Excel 2019 and earlier show #NAME?. The overview of dynamic arrays in Excel explains what else arrived at the same time.
Why use LET? A formula without it#
LET exists because long formulas often repeat the same piece. Take this sales table in A1:C8:
| A | B | C | |
|---|---|---|---|
| 1 | Rep | Region | Sales |
| 2 | Ana | North | 4,200 |
| 3 | Ben | South | 3,100 |
| 4 | Cara | North | 5,600 |
| 5 | Dev | East | 2,900 |
| 6 | Eli | North | 3,800 |
| 7 | Fay | South | 4,700 |
| 8 | Gus | East | 3,300 |
The North team earns a 5% bonus on its total sales if the total is over 10,000, and 3% if not. Without LET, the formula repeats the North total three times:
=IF(SUM(FILTER(C2:C8,B2:B8="North"))>10000,SUM(FILTER(C2:C8,B2:B8="North"))*5%,SUM(FILTER(C2:C8,B2:B8="North"))*3%)It works, but it is hard to read, and if the region changes you must edit it in three places. Excel also runs the same FILTER three times.
How to write a LET formula, step by step#
Here is the same bonus with LET:
=LET(north, FILTER(C2:C8,B2:B8="North"), total, SUM(north), IF(total>10000, total*5%, total*3%))Read it from left to right:
north, FILTER(C2:C8,B2:B8="North")names the list of North sales: 4,200, 5,600 and 3,800.total, SUM(north)adds that list and names the answer: 13,600. A later name can use an earlier one.IF(total>10000, total*5%, total*3%)is the calculation. 13,600 is over 10,000, so the result is 13,600 × 5% = 680.
To change the region, you now edit one word. If you are new to FILTER, the FILTER function guide and the article on how FILTER returns matching rows explain it.
Long LET formulas are easier to read on several lines. Press Alt+Enter (Mac: Option+Return) inside the formula bar to start a new line, and widen the formula bar with the arrow at its right edge.
Rules for LET names#
LET names follow the same rules as defined names, with a few extra points:
- Start with a letter (or an underscore). Don't use spaces.
north_totalworks,north totaldoesn't. - A name can't look like a cell address.
tax1is fine, butTAX2026is a real cell in column TAX, so Excel rejects it. - Names are not case-sensitive.
Totalandtotalare the same name. - Each name exists only inside its own formula. Another cell can't use it.
- You need pairs. Name, value, name, value, and then one final calculation. An even number of arguments means the calculation is missing, and Excel will not accept the formula.
If you want a name the whole workbook can use, create a defined name with Formulas > Define Name instead. LET is for names that only one formula needs.
When does LET make formulas faster?#
LET helps speed when a heavy piece is repeated. Every FILTER, XLOOKUP or SUMPRODUCT in a formula is a calculation. Without LET, a piece that appears three times runs three times. With LET, it runs once.
On a small sheet you won't notice. On a large model with thousands of rows, removing repeated lookups can matter. The guide to why Excel formulas get slow lists other fixes.
LET is also a neat way to avoid repeating a lookup just to hide a blank or an error, a pattern you will know from making VLOOKUP return blank instead of 0:
=LET(price, XLOOKUP(F2,A2:A8,C2:C8,""), IF(price="","",price*1.2))The lookup runs once, and the name price is checked and used.
Common LET errors#
Most LET errors come from missing pieces:
- #NAME? in older Excel. The file was opened in Excel 2019 or earlier. Replace LET with a normal formula, or use helper columns.
- #NAME? in new Excel. A name is misspelled in the calculation, or it is used before it is defined. Names must be defined left to right.
- "There's a problem with this formula". Usually a missing comma, or no final calculation after the last pair.
- A name that looks like a cell. Names such as
q1orQ2026are real cell addresses, so Excel rejects them. Useq_1orq_2026instead.
To check a LET formula, select the cell and use Formulas > Evaluate Formula (Windows) to step through it, or test each value in a spare cell first.
Practise it#
LET is easiest once FILTER and the other modern functions feel natural. Start with the exercise on this page, which builds the north piece. Then practise FILTER in a live spreadsheet and work through the modern Excel functions lesson, where every formula is checked as you type. When you can write the pieces, wrapping them in LET is one small step.
Try it yourself
This is a live spreadsheet. Type the formula in the green cell and press Enter.
This is the piece a LET formula would name north. In G2, total the Sales (C2:C8) for the North region with =SUM(FILTER(C2:C8,B2:B8="North")), then press Enter.
| A | B | C | D | E | F | G | H | |
|---|---|---|---|---|---|---|---|---|
| 1 | Sales | |||||||
| 2 | North total | |||||||
| 3 | ||||||||
| 4 | ||||||||
| 5 | ||||||||
| 6 | ||||||||
| 7 | ||||||||
| 8 | ||||||||
| 9 | ||||||||
| 10 | ||||||||
| 11 |
Tip: FILTER keeps the Sales values where the Region is North. SUM adds what FILTER returns.
Practise this in a lesson
Frequently asked questions
What does the LET function do in Excel?
LET lets you name a value or calculation inside a formula, then use that name in the final calculation. It removes repeated pieces, makes long formulas readable and calculates each named part only once.
Which versions of Excel have LET?
LET is available in Microsoft 365, Excel 2021, Excel 2024 and Excel for the web. Excel 2019 and earlier do not have it and show #NAME? instead.
How many names can I define with LET?
Up to 126 name and value pairs. In practice two to five names cover most formulas, and more than that usually means the work belongs in helper columns.
Can I use a LET name in another cell?
No. A LET name exists only inside the formula that defines it. To reuse a name across the workbook, create a defined name with Formulas > Define Name instead.
Does LET make formulas faster?
It can. Without LET, a repeated piece such as a FILTER or a lookup is calculated every time it appears. With LET it is calculated once and reused, which helps most in large or array-heavy workbooks.