Advanced Logic Last updated: 2026-08-20

LET Function in Excel & Google Sheets (Variables in Spreadsheet Formulas)

Assign names to calculation results, eliminate redundant formulas, and boost spreadsheet performance with the LET function.

Quick Answer & Formula
Excel Sheets Advanced
=LET(name1, value1, [name2, value2, ...], calculation)

The LET function lets you declare local variables inside a formula. It eliminates recalculating the same sub-expression multiple times, making complex formulas cleaner, faster, and easier to debug.

LET Function in Excel & Google Sheets

The LET function brings modern programming variable declaration to spreadsheet formulas. By naming intermediate values, you drastically improve formula readability and eliminate redundant calculation overhead.


1. Before vs. After: Eliminating Redundant Calculations

❌ Traditional Repetitive Formula:

=IF(XLOOKUP(A2, Products!A:A, Products!D:D) > 500, XLOOKUP(A2, Products!A:A, Products!D:D) * 0.9, XLOOKUP(A2, Products!A:A, Products!D:D))

Excel runs the heavy XLOOKUP up to 3 times for every single row.

✅ Modern, Fast LET Formula:

=LET(
  price, XLOOKUP(A2, Products!A:A, Products!D:D),
  IF(price > 500, price * 0.9, price)
)

XLOOKUP executes exactly once per row, cutting workbook calculation time by up to 66%.


2. Multi-Variable Commission Model Example

=LET(
  sales, B2,
  baseRate, 0.08,
  bonusRate, 0.15,
  quota, 100000,
  IF(sales > quota, (quota * baseRate) + ((sales - quota) * bonusRate), sales * baseRate)
)
?

Frequently Asked Questions

Why does LET dramatically speed up large spreadsheets?

Without LET, if you write IF(VLOOKUP(...) > 100, VLOOKUP(...)*0.9, VLOOKUP(...)), Excel performs the expensive VLOOKUP 3 times. With LET, Excel executes the VLOOKUP once, stores it in memory, and reuses the result.