Example 1
Name the gross amount and reuse it
D2 =LET(gross,A2*B2,gross-gross*C2)
Result: 67.5
20 x 4.50 = 90 is stored as gross. Taking 25% off gives 67.50. Without LET you would type A2*B2 twice.
D2 =LET(gross,A2*B2,gross-gross*C2) returns 67.5
Gives names to values or calculations inside a formula, so each is worked out once and the formula reads in plain steps.
Syntax
=LET(, , , [name_value2, calculation_or_name3], …)
Excel for Microsoft 365, Excel 2021 and later, and Excel for the web. Not available in Excel 2019 or earlier.
Try it
Edit the formula in D2 or change the inputs. The sheet recalculates as you type.
D2 =LET(gross,A2*B2,gross-gross*C2) returns 67.5
LET lets you name the pieces of a formula. Each name is worked out once, and every later use of it reads the stored result. The formula gets shorter, easier to read and often faster.
LET takes pairs of a name and its value, followed by one final calculation:
=LET(gross, A2*B2, gross - gross*C2)
Here gross is the name, A2*B2 is its value, and gross - gross*C2 is the result. Add more pairs before the final calculation, as many as you need. The last argument is always the calculation, which is why LET always has an odd number of arguments.
Later names can use earlier ones. =LET(gross,A2*B2,disc,gross*C2,gross-disc) defines the discount from the gross amount and then returns the net.
avg and gross say more than AVERAGE(B2:B7) repeated three times.A name can stand for a whole range or an array result. =LET(s,B2:B7,FILTER(A2:A7,s>AVERAGE(s))) names the sales column s and uses it twice: once for the test and once inside AVERAGE. The formula spills like any FILTER result. See FILTER for spill ranges.
A name must begin with a letter or underscore, and it can't look like a cell address. tax1 is a valid cell address, so it isn't allowed, but tax_rate is fine. The names exist only inside that one formula. They don't appear in the Name Manager, and other cells can't use them.
A name can only be used after it has been defined. If a calculation refers to a name that comes later in the formula, you get #NAME?.
LET can hold a LAMBDA as a value, which gives you a small reusable function inside one formula: =LET(tax,LAMBDA(x,x*0.25),tax(B3)+tax(B4)). The helper functions MAP, REDUCE and BYROW often appear inside a LET for the same reason.
To check an intermediate step, temporarily make the name the final argument: change LET(a,..., b,..., b*2) to LET(a,..., b,..., b) and read what b holds. Using F9 on a selected part of the formula works in the formula bar too.
LET needs Microsoft 365, Excel 2021 or later, or Excel for the web. In Excel 2019 and earlier the formula returns #NAME?.
gross. It must start with a letter and can not look like a cell reference such as A1 or tax1.Each example is a live sheet. Change the inputs or the formula and watch the result.
Example 1
D2 =LET(gross,A2*B2,gross-gross*C2)
Result: 67.5
20 x 4.50 = 90 is stored as gross. Taking 25% off gives 67.50. Without LET you would type A2*B2 twice.
D2 =LET(gross,A2*B2,gross-gross*C2) returns 67.5
Example 2
D2 =LET(gross,A2*B2,disc,gross*C2,vat,(gross-disc)*0.2,gross-disc+vat)
Result: 81
gross is 90, disc is 22.50, and vat is 20% of the 67.50 left, which is 13.50. The result is 67.50 + 13.50 = 81.
D2 =LET(gross,A2*B2,disc,gross*C2,vat,(gross-disc)*0.2,gross-disc+vat) returns 81
Example 3
D2 =LET(s,B2:B7,FILTER(A2:A7,s>AVERAGE(s)))
Result: Dock St; High St; Quay Side
The average of the six sales is 116.67. s names the sales range, so it is typed once and used for the test and in AVERAGE. Three stores are above average.
D2 =LET(s,B2:B7,FILTER(A2:A7,s>AVERAGE(s))) returns Dock St; High St; Quay Side
Example 4
D2 =LET(total,SUM(B2:B5),B2:B5/total)
Result: 0.2; 0.3; 0.1; 0.4
total is worked out once and then divided into each of the four values. Format the result as a percentage to read it as shares.
D2 =LET(total,SUM(B2:B5),B2:B5/total) returns 0.2; 0.3; 0.1; 0.4
Example 5
D2 =LET(tax,LAMBDA(x,x*0.25),tax(B2)+tax(B3))
Result: 40
tax is a LAMBDA that returns a quarter of its input. It is defined once and called for each sale: 25 + 15.
D2 =LET(tax,LAMBDA(x,x*0.25),tax(B2)+tax(B3)) returns 40
Solve it in the sheet. Every answer is checked, with hints if you need them.
Task 1 of 2
In D2, use LET to name the gross amount (quantity times unit price), then return the gross amount less the discount in C2.
Answer in D2.
tax1, q4 and fy25 are all cell addresses in Excel. Use tax_1, q4_total or rate instead.gross from another cell. For a reusable function, save a LAMBDA in the Name Manager.=LET(a,1), is refused.#NAME?.#SPILL! means the cells it needs are not empty.It assigns names to values or calculations inside one formula. Each name is worked out once, and later parts of the formula can use it, so repeated expressions are written once and formulas are easier to read.
It can. An expression you would otherwise repeat is calculated once and the stored result is reused. On a large range, such as an expression inside several FILTER tests, this saves real time.
Names cannot look like a cell reference, such as `A1` or `tax1`, and must start with a letter or underscore. Use a name with an underscore, such as `tax_rate`.
No. The names exist only inside the formula that defines them. To reuse something across the workbook, define a named range or a named LAMBDA in the Name Manager.
No. It is available in Microsoft 365, Excel 2021 and later, and Excel for the web. In Excel 2019 and earlier the formula returns `#NAME?`.
LET is taught in Data analysis with formulas, lesson 14: LET: name your calculations. Each lesson is a short, graded exercise like the one above.