LET Function

Excel 365, Excel 2021

Summary

The LET function creates temporary variables within a formula, storing intermediate calculations for reuse. This dramatically improves formula performance, readability, and maintainability by eliminating repetitive calculations and providing meaningful names for complex expressions.

Syntax

=LET(name1, name_value1, calculation_or_name2, [name_value2, calculation_or_name3...])

Parameters

Parameter Type Required Description
name1 Text Yes Required first variable name. Must begin with letter and follow name manager rules.
name_value1 Any Yes Required value, reference, or formula assigned to name1.
calculation_or_name2 Any Yes Either the final calculation result or name2 for additional variables (requires pairs).

Using the LET Function

LET revolutionizes complex formula creation by letting you define meaningful variables for intermediate results. Perfect for dynamic arrays, nested calculations, and data transformations where the same expression would otherwise be repeated multiple times.

Common LET Examples

Simple Variable Example

=LET(x, 5, SUM(x, 1))

Defines x=5 then returns 6. Basic demonstration of variable assignment.

Data Filtering with Variables

=LET(filterCriteria,"Fred",filteredRange, FILTER(A2:D8,A2:A8=filterCriteria), IF(ISBLANK(filteredRange),"-",filteredRange))

Filters sales data for 'Fred', replaces blanks with dashes. Twice as fast as equivalent without LET.

Complex Math Optimization

=LET(base, A1*B1, taxRate, 0.08, discount, 0.1, (base*(1-discount))*(1+taxRate))

Calculates final price with reusable tax/discount variables, avoiding repeated A1*B1 calculations.

Frequently Asked Questions

Names must start with a letter, contain no spaces, and avoid conflicts with cell references (like single letters that match R1C1 style).

Yes, LET excels with dynamic arrays, FILTER, SORT, and other modern functions by storing array results once.

Up to 126 name-value pairs before the final calculation.

Common Errors and Solutions

#NAME? error

Cause: Invalid variable name (starts with number, contains spaces, or conflicts with references)

Solution: Use valid names like 'SalesTotal', 'TaxRate', avoid single letters like 'c'.

#VALUE! error

Cause: Odd number of arguments before final calculation

Solution: Name-value pairs must come in even sets: name1, value1, name2, value2, ..., final_calculation

Circular reference

Cause: Variable references itself directly or indirectly

Solution: Ensure calculation sequence doesn't create circular dependencies

Notes

  • Last argument MUST be a calculation that returns a result
  • Variable scope limited to current LET formula
  • Names calculated left-to-right, available to later variables
  • Ideal companion for FILTER, SORT, UNIQUE, SEQUENCE functions

Compatibility

Available in: Excel 365, Excel 2021

Not available in: Excel 2019, Excel 2016, Excel 2013, Excel 2010, Excel 2007, Excel 2003

Content last reviewed: December 9, 2025
Update frequency: As needed
Excel versions tested: Excel 365, Excel 2021