How to Use the LET Function: Excel Trick to Reduce Formula Complexity by Half

Microsoft Excel is powerful, but its formulas can quickly become cumbersome. But luckily there is a way to simplify even the most cumbersome formulas without losing their functionality.

Microsoft Excel is powerful, but its formulas can quickly become cumbersome. But thankfully there is a way to simplify even the most cumbersome formulas without losing their functionality, and it has completely changed the way many people work.

 

What is the LET function?

LET is a function in Excel that allows you to add variables to formulas to make them more manageable and efficient.

Think of variables as labeled containers that store different values, such as numbers or text. They make values easier to reuse and manipulate, especially if they are the result of intermediate calculations. That's because you can refer to them by the name of their corresponding container instead of directly.

Here is the syntax of the LET function:

=LET(variable_name_1, value_to_assign_1, [variable_name2, assigned_value2, .], final_calcul

In the syntax, variable_name_1 is the name or label of the variable you want to use. For example, if you need to store the weight of something, you just call it weight . The value_to_assign_1 parameter is the value you want to assign to variable_name_1.

You can also create additional variables and assign names to them, which is where the optional arguments [variable_name2, assigned_value2, .] come in. And final_calculation is the formula that uses the named variables to produce the result.

LET is one of those Excel functions that can save you a lot of work in the long run. However, it requires anyone looking at an Excel spreadsheet to have a grasp of the concept of variables, in addition to how functions work. However, it is worth learning, as we will see in the example in the next section.

 

How the LET function makes formulas easier to read

The best use case for the LET function is to reduce the complexity of a formula by using some intermediate calculations. Let's look at the sample data below that shows the price, quantity, and discount percentage of an item.

We will use basic math in Excel to calculate the total cost of the product after calculating all the factors. The syntax of the calculation is as follows:

total_cost = subtotal - (subtotal * discount_rate)

Let's analyze what's going on here:

  • First, we need to calculate the subtotal , which is the price (A2) multiplied by the quantity (A3).
  • Second, we need to know the discount amount, i.e. subtotal multiplied by the discount rate (A4).
  • Finally, we calculate the total cost by subtracting the discount amount from the subtotal.

The formula would look like this in Excel if we hardcode the values:

=(1000 * 3) - ((1000 * 3) * 0.1)

There are a few issues here that make this formula complicated. The most prominent issue is that the subtotal calculation (1000 * 3) is repeated twice, making the formula hard to read. This is also bad for performance, because Excel repeats the calculation instead of just reusing the result.

 

Imagine if we repeated that calculation multiple times in the formula. That means if we change any element in that calculation, we have to change it everywhere it is repeated. That is a tedious and error-prone process.

Also, it's hard to know what the individual numbers mean. For example, when calculating a subtotal, does 1000 represent the quantity or the price of the item? There's no clarity on what those numbers mean.

Reading the formula isn't much easier either if we use cell references, as in the example below:

=(B2 * B3) - ((B2 * B3) * 4)

When we use the LET function, the formula becomes easier to read because we build the formula gradually, removing complexity step by step. Here is an example to illustrate (the article will put everything on a separate line to make the example easier to follow):

=LET( price, B2, quantity, B3, discount_rate, 4, subtotal, price * quantity, discount_amount, subtotal * discount_rate, subtotal - discount_amount )

Here, the values in cells A2, A3 , and A4 become easier to understand as price , quantity , and discount_rate respectively. Now, we just need to use those named variables to calculate the subtotal and discount amount. As you can see, each value is assigned to a variable once, either by referring to a cell or storing the result of an intermediate calculation, and then reused throughout the process.

Plus, it's easy for others to follow along as you calculate your total costs. And if we change the values in the variables (for example, using a different cell reference or adding another variable to intermediate calculations), we don't have to edit the formula in multiple places.

Rules to keep in mind when naming variables

Before using the LET function with your formulas, you should learn some rules and best practices when naming variables.

Please note the following:

  • Make sure the names describe the values you will assign to them.
  • Names can contain letters and numbers.
  • Do not use names that Excel has reserved (for example, SUM, MAX, or IF).
  • You can't use spaces when naming variables, so if you want to separate words, either wrap them together (e.g. discountAmount) or use underscores (e.g. discount_amount).
  • Use the same naming convention consistently throughout - avoid combining both capitalization and underscores.
  • Do not use special characters other than underscores.

Functions like LET make your formulas easier to read, which is great for collaboration. Plus, if you revisit your formulas months later, it's much easier to remember what they do if you have descriptive names. This is a very useful function that greatly reduces complexity by simplifying the way you interact with formulas, even as they become more verbose.

Related posts
Other Application articles
Category

System

Windows XP

Windows Server 2012

Windows 8

Windows 7

Windows 10

Wifi tips

Virus Removal - Spyware

Speed ​​up the computer

Server

Security solution

Mail Server

LAN - WAN

Ghost - Install Win

Fix computer error

Configure Router Switch

Computer wallpaper

Computer security

Mac OS X

Mac OS System software

Mac OS Security

Mac OS Office application

Mac OS Email Management

Mac OS Data - File

Mac hardware

Hardware

USB - Flash Drive

Speaker headset

Printer

PC hardware

Network equipment

Laptop hardware

Computer components

Advice Computer

Game

PC game

Online game

Mobile Game

Pokemon GO

information

Technology story

Technology comments

Quiz technology

New technology

British talent technology

Attack the network

Artificial intelligence

Technology

Smart watches

Raspberry Pi

Linux

Camera

Basic knowledge

Banking services

SEO tips

Science

Strange story

Space Science

Scientific invention

Science Story

Science photo

Science and technology

Medicine

Health Care

Fun science

Environment

Discover science

Discover nature

Archeology

Life

Travel Experience

Tips

Raise up child

Make up

Life skills

Home Care

Entertainment

DIY Handmade

Cuisine

Christmas

Application

Web Email

Website - Blog

Web browser

Support Download - Upload

Software conversion

Social Network

Simulator software

Online payment

Office information

Music Software

Map and Positioning

Installation - Uninstall

Graphic design

Free - Discount

Email reader

Edit video

Edit photo

Compress and Decompress

Chat, Text, Call

Archive - Share

Electric

Water heater

Washing machine

Television

Machine tool

Fridge

Fans

Air conditioning

Program

Unix and Linux

SQL Server

SQL

Python

Programming C

PHP

NodeJS

MongoDB

jQuery

JavaScript

HTTP

HTML

Git

Database

Data structure and algorithm

CSS and CSS3

C ++

C #

AngularJS

Mobile

Wallpapers and Ringtones

Tricks application

Take and process photos

Storage - Sync

Security and Virus Removal

Personalized

Online Social Network

Map

Manage and edit Video

Data

Chat - Call - Text

Browser and Add-on

Basic setup