Excel Intermediate Lesson 8: LET for Readable, Faster Formulas

Excel Intermediate Lesson 8: LET for Readable, Faster Formulas 1

πŸ“Ž This article includes 1 downloadable practice file ↓

⏱ 2 min read

πŸ“˜ Excel Intermediate Course Β· Lesson 8 of 12

Advertisement
In this article
  1. Before and after
  2. Real uses
  3. Debugging a LET
  4. Common mistakes
  5. Practice

LET gives names to pieces of a formula, inside the formula. The result is shorter, easier to check, and faster, because each piece is calculated once.

Before and after

Before: =SUMIFS(K:K,D:D,"North")/SUM(K:K)*100 - IF(SUMIFS(K:K,D:D,"North")/SUM(K:K)>0.3, 5, 0)
After:  =LET(north, SUMIFS(K:K,D:D,"North"),
             total, SUM(K:K),
             share, north/total,
             share*100 - IF(share>0.3, 5, 0))

Pattern: LET(name1, value1, name2, value2, ..., final_calculation). The last argument is always the result.

Real uses

Task Formula
Amount with GST from the master =LET(amt,K2,gst,XLOOKUP(F2,Master!A:A,Master!E:E),ROUND(amt*(1+gst),2))
Top rep by sales =LET(r,UNIQUE(C2:C81),s,SUMIFS(K2:K81,C2:C81,r),INDEX(r,MATCH(MAX(s),s,0)))
Gap between best and worst rep =LET(r,UNIQUE(C2:C81),s,SUMIFS(K2:K81,C2:C81,r),MAX(s)-MIN(s))
πŸ’‘ Press Alt+Enter inside the formula bar to put each name on its own line, as above. Excel ignores the line breaks.

Debugging a LET

Change the last argument to one of the names, e.g. replace the final calculation with s, to see that intermediate result. Then put the calculation back.

Common mistakes

  • Names that look like cells (tax1, gst18) give #NAME?. Use tax_amt.
  • Forgetting the final calculation: an even number of arguments means the result is missing.

Practice

Download this lesson’s workbook below. Write each one without LET first, then rewrite it. Type your formula in the yellow column; the Check column turns green when the result matches, and the Answers sheet has a working formula for every task.

πŸ“Ž Practice files for this article

Free to use for learning. Files with macros (.bas) are plain text β€” import them with Alt+F11 β†’ File β†’ Import File, and always test on a copy.

Advertisement
✨ Ask AI about this article

Stuck on a step? Ask a question and the AI answers using this article.

Free Β· AI can be wrong