Google Sheets LET Function: Syntax, Examples & Tips

The LET function allows you to define named variables for calculations, improving readability and efficiency in your formulas.
Google Sheets
LET(name1, value_expression1, [name2, …], [value_expression2, …], formula_expression )

One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.

On this page
  1. Parameters
  2. What is a LET Function?
  3. A Practical Example
  4. LET Formula
  5. Result of the Formula
  6. Why Use LET?
  7. Key Takeaways:
  8. Example use case

Parameters

name1: The first name you want to assign to a value expression within the LET function.

value_expression1: The value or expression that corresponds to name1. This can be a calculation, a constant, or a reference to a cell.

name2: (Optional) The second name you want to assign to another value expression within the LET function.

value_expression2: (Optional) The value or expression that corresponds to name2. This can also be a calculation, a constant, or a reference to a cell.

formula_expression: The final expression that uses the defined names (name1, name2, etc.) to compute a result based on the values assigned to them.

What is a LET Function?

The LET function in Google Sheets is a powerful tool that allows users to define named variables in their formulas. This function can simplify complex calculations by storing intermediate results, making formulas easier to read and manage. By using LET, you can enhance performance and clarity in your spreadsheets.

In simpler terms, the LET function enables you to assign names to calculation results, which can then be reused within the same formula, reducing redundancy and improving efficiency.

A Practical Example

Imagine you are calculating the total cost of items purchased, including tax and discount, and you want to keep your formula organized:

Purchase Table:

ItemIDItemNamePriceQuantityDiscountTaxRate
1Widget A25.00310%5%
2Widget B30.0025%5%

You want to calculate the total cost for each item, factoring in the discount and tax.

LET Formula

To achieve this, you would use the LET function as follows:

Google Sheets
=LET(
    price, C2,
    quantity, D2,
    discount, E2,
    taxRate, F2,
    discountedPrice, price * (1 - discount),
    totalCost, discountedPrice * quantity * (1 + taxRate),
    totalCost
)

In this formula:

  • price, quantity, discount, and taxRate are named variables that store the respective values from the Purchase Table.
  • discountedPrice calculates the price after applying the discount.
  • totalCost calculates the final cost including tax.
  • The final line returns the totalCost.

Result of the Formula

When you apply the LET formula to the Purchase Table, the output would look like this:

ItemIDItemNamePriceQuantityDiscountTaxRateTotal Cost
1Widget A25.00310%5%79.88
2Widget B30.0025%5%63.00

In this case, the LET function allows you to clearly see how the total cost is calculated without repeating the same calculations multiple times.

Why Use LET?

The LET function is beneficial because it simplifies complex formulas, making them easier to read and maintain. By defining variables, you can avoid repetitive calculations, which can enhance performance, especially in large datasets. Additionally, it helps in debugging and understanding formulas by breaking them down into manageable parts.

Key Takeaways:

  • LET: A modern Google Sheets function that allows you to define named variables for use in formulas.
  • Simplifies Formulas: Makes complex calculations easier to read and manage.
  • Performance Improvement: Reduces redundancy in calculations, enhancing spreadsheet performance.
  • Common Use Cases: Ideal for financial calculations, data analysis, and any scenario where clarity and efficiency are needed.

LET is an essential function for anyone working with data in Google Sheets, providing a powerful way to enhance data analysis and reporting capabilities.

Happy spreadsheeting!

Example use case

You have a sales data table with Column A listing product IDs and Column B showing product names. Use XLOOKUP to input a product ID and instantly fetch the product name, streamlining inventory management and enhancing order processing efficiency.

Need more help with Google Sheets formulas?

Sign up for Better Analyst and get unlimited AI-powered formula generation, explanations, and advanced data analysis.

Compare your options

Decide with evidence, not a sales pitch.

Open a neutral research prompt in the AI tool you already use. Compare capabilities, limitations, and fit before you choose.

  1. 01ChatGPTOpen a balanced comparison prompt in ChatGPT.
  2. 02ClaudeOpen the same research prompt in Claude.
  3. 03PerplexityResearch the comparison with linked web sources.

AI answers can be incomplete. Check source links, current pricing, and product documentation before deciding.