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.

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

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:

  1. Faster Performance: Excel calculates the variable only once instead of recalculating duplicate formulas.
  2. Easier to Read: Replaces long, complex nested formulas with clean, named variables.
  3. 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 to name1 (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.

Advertisement

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

  1. Use Clear Variable Names: Give your variables meaningful names like subtotal, tax_rate, or sales_data instead of vague letters like x or y.
  2. Dramatically Speeds Up Big Files: Replacing duplicate VLOOKUP or INDEX/MATCH functions with LET eliminates redundant calculations and makes large workbooks open and recalculate much faster.
  3. Variables Are Local Only: Variable names defined inside LET only exist within that specific formula and won't conflict with names in other cells.
  4. Excel Version Requirement: LET function requires Microsoft 365, Excel 2021, or Excel for the Web.

📚 Related Resources & Tutorials

Found this tutorial helpful? Share it with colleagues:
📚

Related Tutorials

Opens in new tab ↗
Advertisement