How to Use LET Function in Excel + Tips
Learn how to use LET function in Excel step-by-step to define variables in formulas with simple examples, benefits, and tips.
Hello everyone! Today i will show you how to use LET function in Microsoft Excel step by step.
1. What is LET Function in Excel?
The LET function is a powerful Excel feature (available in Excel 365 and Excel 2021+) that allows you to assign names to values or calculation results inside a formula.
Instead of writing the same long formula multiple times inside an IF statement, you can define it once as a variable name and reuse it as many times as you need!
Key Benefits of LET:
- Faster Performance: Excel calculates the variable only once instead of recalculating duplicate formulas.
- Easier to Read: Replaces long, complex nested formulas with clean, named variables.
- Easier to Maintain: If you need to change a calculation, you only edit it in one place!
📚 Related Tutorial: Want to look up values efficiently? Check out How to Use XLOOKUP Function in Excel!
2. 🛠️ Formula Syntax & Parameters
=LET(name1, value1, calculation)
=LET(name1, value1, name2, value2, ..., calculation)
name1: Required. The variable name you create (e.g.,total,tax,lookup_val).value1: Required. The value or formula assigned toname1(e.g.,A2 * B2).[name2, value2]: Optional. Additional variable names and values you want to define.calculation: Required. The final expression/calculation using the defined variable names.
3. 📋 Practical Examples
Example 1: Simplify Repeated Calculations (Calculate Discount)
Suppose Quantity is in cell A2 = 10 and Unit Price is in B2 = $50. You want to calculate the total price with a 10% discount:
Without LET (Repeats A2 * B2 twice):
=(A2 * B2) - ((A2 * B2) * 0.10)
With LET Function:
=LET(subtotal, A2 * B2, subtotal - (subtotal * 0.10))
👉 Result: $450
(Excel calculates subtotal = $500 once, then evaluates $500 - ($500 * 0.10))
Example 2: Avoid Duplicate Lookups in IF Statements
Suppose cell A2 contains a Product ID, and you want to look up sales with XLOOKUP. If sales exceed $1,000, give a 10% bonus; otherwise give $0:
Without LET (Runs XLOOKUP twice):
=IF(XLOOKUP(A2, E2:E10, F2:F10) > 1000, XLOOKUP(A2, E2:E10, F2:F10) * 0.10, 0)
With LET Function:
=LET(sales, XLOOKUP(A2, E2:E10, F2:F10), IF(sales > 1000, sales * 0.10, 0))
👉 Result: Excel performs the XLOOKUP only once, making your spreadsheet run significantly faster!
Example 3: Defining Multiple Variables (Calculate Final Salary)
Suppose Base Salary is in A2 = $1,000, Bonus is in B2 = $200, and Tax Rate is 15%:
=LET(
gross, A2 + B2,
taxRate, 0.15,
taxAmount, gross * taxRate,
gross - taxAmount
)
👉 Result: $1,020 ($1,200 gross - $180 tax).
💡 Quick Tips for Using LET Function
- Use Clear Variable Names: Give your variables meaningful names like
subtotal,tax_rate, orsales_datainstead of vague letters likexory. - Dramatically Speeds Up Big Files: Replacing duplicate
VLOOKUPorINDEX/MATCHfunctions withLETeliminates redundant calculations and makes large workbooks open and recalculate much faster. - Variables Are Local Only: Variable names defined inside
LETonly exist within that specific formula and won't conflict with names in other cells. - Excel Version Requirement:
LETfunction requires Microsoft 365, Excel 2021, or Excel for the Web.
📚 Related Resources & Tutorials
Related Tutorials
Opens in new tab ↗How to Use LAMBDA Function in Excel + Tips
Learn how to use LAMBDA function in Excel step-by-step to define variables in formulas with simple examples, benefits, and tips.
How to Use AGGREGATE Function in Excel + Tips
Learn how to use AGGREGATE function in Excel step-by-step to calculate SUM, AVERAGE, MAX, LARGE while ignoring errors and hidden rows.
How to Use DROP Function in Excel + Tips
Learn how to use DROP function in Excel step-by-step to remove specified rows or columns from the start or end of a range with simple examples and tips.