Excel's New "LET" Function Can Simplify Your Formulas

Excel's New LET Function Can Simplify Your Formulas

If you access Excel through an Office 365/Microsoft 365 subscription, get ready for the new LET function.  LET began appearing in select releases of Excel in July 2020 and will continue to roll-out over the upcoming year. In essence, LET allows you to declare and store a variable inside a formula. Once you establish the variable with LET, you can then use that variable repeatedly in the same formula. In this article, you will learn how Excel’s new LET function can simplify your formulas.

Excel

LET Fundamentals

“Old-school” programmers no doubt remember the days of declaring variables in a computer program using a LET function. While writing code, programmers might include a statement such as “LET x = 100.” With “x” established as the value of “100,” they would then use that variable in other calculations. Excel’s new LET function provides essentially the same functionality, with one notable difference. With LET, you can only use the variable you declare in the same formula that contains the LET function.

As a simplified first example of working with LET, consider the following formula in Excel.

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

The formula shown first establishes “x” as a variable with a value of “100.” It then adds that value to “1” to produce a calculated value of “101.” The fundamental example provided is just that – a simple example to introduce LET. Let’s turn our attention to some more practical uses of LET. But first, let’s describe why LET is potentially beneficial to Excel users.

LET Benefits

According to Microsoft, LET offers two primary benefits: 1) Improved Performance and 2) Easy Reading and Composition. More specifically:

  1. Improved Performance.If you write the same expression multiple times in a formula, Excel calculated that result numerous times. LET allows you to call the expression by name and for Excel to calculate it once.
  2. Easy Reading and Composition.No more having to remember what a specific range/cell reference referred to, what your calculation was doing, or copy/pasting the same expression. With the ability to declare and name variables, you can give meaningful context to yourself and consumers of your formula.

From the above, we can conclude that LET allows us to improve our formulas by making them easier to understand while simultaneously speeding calculation times.

A Practical Example Of How The LET Function Can Simplify Your Formulas

In this illustration, let us assume that a loan officer is deciding whether to approve a mortgage on a house. Further, the bank’s policy is to charge 0.5% more interest if the applicant’s credit score is less than 800. In this case, we can use the following formula to calculate the monthly payment based on the inputs shown in Figure 1.

=LET(Rate,(IF(B4>799,B2,B2+0.005)),PMT(Rate/12,B3*12,-B1))

Figure 1 - Using LET to Calculate a Payment Based on a Credit Score

In the formula pictured above, the LET function declares a variable named “Rate.” Further, the LET function uses a nested IF function to retrieve the value from cell B4 and determine if it is less than 800. If so, the interest rate increases by 0.5%. Finally, the formula calculates the monthly payment by incorporating the “Rate” variable established by the LET function. In this example, using LET facilitates creating a more concise calculation than would otherwise be possible.

Further, the advantages of using LET increase as the complexity of the calculation increases. For example, if the loan officer establishes the interest rate based on three tiers of credit scores instead of two, the value of using LET magnifies significantly.

Summary

Excel’s new LET function allows you to simplify calculations in Excel by declaring variables within a formula. Once you establish such a variable, you can use it repeatedly in the same expression to ease the process of creating complex calculations. In this context, Excel’s new LET function can simplify your formulas. Therefore, as this feature becomes available to you, carefully consider how you can use it to get better results in less time.

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn

See more about LET from Microsoft by clicking here. 

Interested in learning more about Excel? Consider a K2 Enterprises training event! Click here to learn more about the options available to you.

Learn More About LET In This Video

Leave a reply

Your email address will not be published. Required fields are marked *