Home / Formula Types / Logical / Let

Formula generator for LET function

The LET function assigns names to values and allows the use of those names in subsequent calculations. It is useful for simplifying complex formulas and improving readability.

Formula generator

Spreadsheet AI is the #1 AI for generating and comprehending Excel and Google Sheets formulas. With its advanced capabilities, it goes beyond the basics by providing support for VBA and custom tasks. Streamline your spreadsheet with Spreadshee AI

Product Demo

How to generate an LET formula using AI.

To obtain information on the ARRAY_CONSTRAIN formula, you could ask the AI chatbot the following question: “To obtain the LET formula using an AI chatbot, you could ask the following question: "Is there a way to simplify or optimize my Excel formula by using a single formula instead of repeating calculations? I have some data that requires multiple calculations, and I want to make it more efficient. Can you suggest any alternative Excel formulas or techniques for this?"

LET formula syntax

The LET syntax in Excel allows you to define and name variables within a formula, making it easier to write and understand complex calculations. It follows the format: LET(variable1, value1, variable2, value2, ..., expression) You can define multiple variables and their corresponding values, separated by commas. The last argument is the expression, which is the calculation or formula you want to perform using the defined variables. For example, let's say you want to calculate the area of a rectangle using the length and width variables. Instead of writing the formula as A1*B1, you can use LET to define the variables and make the formula more readable: =LET(length, A1, width, B1, length * width) This way, you can clearly see the variables being used and their values, making the formula easier to understand and modify.

Use Cases & Examples

In these use cases, we use the LET formula to assign values to variables and perform calculations based on those variables. The LET formula allows us to create custom variables within a formula, making it easier to write and understand complex calculations in Excel.

Calculating Total Sales


Calculates the total sales by summing up the sales values for each product.


LET(product1, SUM(B2:B10), product2, SUM(C2:C10), product3, SUM(D2:D10), total_sales, SUM(product1, product2, product3), total_sales)

Calculating Average Revenue


Calculates the average revenue by dividing the total revenue by the number of months.


LET(total_revenue, SUM(E2:E10), num_months, COUNT(E2:E10), average_revenue, total_revenue / num_months, average_revenue)

Calculating Projected Profit


Calculates the projected profit by multiplying the projected revenue with the profit margin.


LET(projected_revenue, F2, profit_margin, G2, projected_profit, projected_revenue * profit_margin, projected_profit)

AI tips

Enhance Your Excel Efficiency with AI Tips: Discover our innovative Excel add-in feature, ‘AI Tips.’ Streamline your workflow and boost productivity as AI-powered suggestions offer real-time insights for optimal spreadsheet organization, data analysis, and visualization. Elevate your Excel experience with intelligent recommendations tailored to your unique needs, helping you work smarter and achieve more.

Provide Clear Context

When describing your requirements to the AI, provide clear and concise context about the data you have, the specific task you want to accomplish, and any relevant constraints or conditions. This helps the AI understand the problem accurately.

Include Key Details

Include important details such as column names, data ranges, and specific criteria that need to be considered in the formula. The more precise and specific you are, the better the AI can generate an appropriate formula.

Use Examples

If possible, provide examples or sample data to illustrate the desired outcome. This can help the AI better understand the pattern or logic you are looking for in the formula.

Mention Desired Functionality

Clearly articulate the functionality you want the formula to achieve. Specify if you are looking for lookups, calculations, aggregations, or any other specific operations.


Frequently Asked Questions

  • The LET function is a new dynamic array function introduced in Excel 2021. It allows you to define and name variables within a formula, making it easier to write and read complex formulas.
  • To use the LET function, you need to define variables and their values using the syntax: LET(variable1, value1, variable2, value2, ...). You can then use these variables within the formula by referencing their names.
  • No, the LET function is only available in Excel 2021 and later versions. If you are using an older version of Excel, you will not be able to use this function.
  • The LET function can make complex formulas easier to understand and maintain by allowing you to break them down into smaller, named variables. It also improves performance by reducing the need for repetitive calculations.
  • Yes, there are a few things to keep in mind when using the LET function. The variables defined within the LET function are only available within that formula and cannot be referenced in other cells. Additionally, the LET function cannot be used in array formulas or as part of conditional formatting.