The Insight Orbit

Where Ideas Orbit the Edge of Innovation

Excel LET and LAMBDA: The Secret to Smarter Dynamic Formulas

Excel LET and LAMBDA: The Secret to Smarter Dynamic Formulas

1. A Quiet Revolution Inside Excel

I remember the first time I saw a formula spill across cells by itself.
No dragging. No copying. Just one cell – and the data flowed like water.

It was strange at first, almost unsettling. I’d spent years managing cell references, absolute signs, and nested IFs like a juggler trying not to drop a ball. And suddenly Excel looked… alive.

Dynamic Arrays changed everything.

And when Excel LET and LAMBDA joined the party, Excel stopped being just a spreadsheet tool – it became a language. A way to think.

If you’ve ever worked in analytics, finance, or data operations, you know that Excel has always been powerful – but messy. Formulas stretched like rubber bands, and once you understood them, you didn’t dare touch them again. These new functions flipped that logic.

They made formulas readable, modular, and almost poetic.


2. Why This Topic Matters

If you’re an advanced user, you’ve likely written formulas that even you didn’t want to revisit later. Nested IFs, repetitive VLOOKUPs, and long SUMPRODUCTs that make your eyes blur.

Now imagine you could name parts of your formula, reuse logic cleanly, and make your spreadsheets dynamic enough to adjust to data changes automatically.

That’s what Dynamic Arrays + LET + LAMBDA offer:

  • Dynamic Arrays eliminate the need for CTRL+SHIFT+ENTER arrays. They auto-expand.
  • LET lets you assign names inside formulas.
  • LAMBDA lets you define your own custom functions.

Together, they turn Excel into something closer to Python – but still delightfully spreadsheet-native.

Honestly, once you start thinking in LET and LAMBDA, you’ll never go back.


3. Understanding the Core Idea

Let’s break this down humanly, not technically.

Dynamic Arrays mean one formula can output multiple results automatically. Think of it as Excel finally understanding plural. If your formula returns multiple values, Excel spills them into the grid – as if it always should’ve done that.

LET is Excel’s way of saying,
“Why keep writing the same logic over and over? Just name it and reuse it.”

Example:

=LET(x, A1 + A2, y, x * 10, y + 5)

Here, x and y are internal variables. You’ve basically created a mini-program inside a formula. Cleaner. Sharper.

LAMBDA goes even further. It lets you create your own functions, just like developers define functions in programming languages.

Example:

=LAMBDA(x, y, x^2 + y^2)

You can even name it using the Name Manager, so you could just type:

=SumOfSquares(A1, A2)

That’s Excel behaving like a proper scripting language – but one that accountants and analysts understand instinctively.


4. The Real Business Case: A Retail Performance Challenge

Let’s bring this down to reality.

Imagine you’re managing performance data for a retail chain with multiple stores.
Every week, you receive a dataset showing:

  • Store Name
  • Region
  • Product Category
  • Units Sold
  • Sales Value
  • Cost
  • Discount %

The finance team wants to analyze:

  1. Gross Profit and Profit % by Store and Category
  2. Compare actual performance vs. regional average dynamically
  3. Build it all in one clean model – without helper columns everywhere

You could do this using traditional Excel formulas. But they’d become ugly fast.
That’s where Dynamic Arrays, LET, and LAMBDA make the difference.


5. Sample Data for Excel Let And LAMBDA

Here’s a compact dataset we’ll use throughout this case study:

StoreRegionCategoryUnits SoldSales ValueCostDiscount %
A101NorthElectronics12024000180005%
A102NorthFurniture80160001200010%
A103SouthElectronics15030000220008%
A104EastApparel200180001100012%
A105WestElectronics9018000135006%
A106SouthFurniture701400095005%
A107NorthApparel230210001300015%
A108WestFurniture10020000145008%
A109SouthElectronics180360002500010%
A110EastApparel210190001200012%
A111NorthFurniture601200085007%
A112WestElectronics13026000190009%
A113EastFurniture75150001000010%
A114SouthApparel220200001250012%
A115WestApparel240220001400014%

Simple enough, but plenty of variety.


6. The Problem

Your goal is to build a dynamic profitability model that:

  • Automatically calculates Gross Profit and Profit %
  • Allows dynamic filtering by Region or Category
  • Uses clean formulas without helper columns
  • Is readable and reusable for any new dataset

And you want to do all this while avoiding:

  • Endless references like B2*E2-F2
  • Nested IFs
  • Messy array formulas with curly braces

This is where LET and LAMBDA start to shine.


7. Building the Base: Calculating Gross Profit Dynamically

Let’s start small.

Traditionally, you’d write:

=SalesValue - Cost

Simple. But let’s say we want to use LET to make it structured and reusable.

Example:

=LET(
sales, [@SalesValue],
cost, [@Cost],
profit, sales - cost,
profit
)

This formula gives you the same result but with readability.
You can glance at it six months later and still understand it.

And because Dynamic Arrays support referencing structured tables, you can apply this logic across the dataset seamlessly.


8. Adding Profit % Calculation with LET

Now, let’s extend it a little:

=LET(
sales, [@SalesValue],
cost, [@Cost],
profit, sales - cost,
profitPct, profit / sales,
profitPct
)

This is now calculating profit percentage for every row, clearly separating variables.
The readability is night and day compared to the old days of =(E2-F2)/E2.

You can even output both values together:

=HSTACK(
LET(
sales, [@SalesValue],
cost, [@Cost],
profit, sales - cost,
profitPct, profit / sales,
CHOOSE({1,2}, profit, profitPct)
)
)

That’s right – one formula, two outputs, dynamically spilled.


9. Creating Reusable Custom Functions with LAMBDA

Now here’s where things get beautiful.

Instead of rewriting that LET block every time, define a LAMBDA function:

=LAMBDA(sales, cost, (sales - cost) / sales)

Name it ProfitPct in Name Manager.

Now, anywhere in your workbook, you can just write:

=ProfitPct([@SalesValue], [@Cost])

That’s professional-grade simplicity.

You’ve created your own Excel function – built on Dynamic Arrays, wrapped in LET, and reusable forever.


10. Dynamic Comparison by Region Using LAMBDA + FILTER

Now the analysis starts getting serious.

Let’s calculate each store’s Profit % vs. its region’s average dynamically.

We’ll first define a function:

=LAMBDA(region, salesRange, costRange,
 LET(
     filteredSales, FILTER(salesRange, regionRange=region),
     filteredCost, FILTER(costRange, regionRange=region),
     avgProfit, AVERAGE((filteredSales - filteredCost) / filteredSales),
     avgProfit
 )
)

You can name this RegionAvgProfit.

Then use:

=RegionAvgProfit([@Region], SalesValueColumn, CostColumn)

Each row dynamically calculates its regional benchmark – no pivot table required.
No helper columns. No static grouping.
Just formulas that think.

11. Expanding the Analysis – From Formulas to Insights

By now, we’ve built our base – a clean, modular formula design using LET and LAMBDA.
But a formula alone doesn’t make an analyst powerful – insight does.

So let’s stretch this dataset a bit further.

We’ll aim to:

  • Dynamically calculate regional averages
  • Compare each store’s Profit % to that benchmark
  • Classify stores as “Above Average” or “Below Average” dynamically
  • Wrap it up with a small reusable dashboard logic

12. Adding Context: Regional Averages and Performance Bands

We already have our RegionAvgProfit function from earlier.
Now, let’s define another LAMBDA function that uses it to classify stores.

=LAMBDA(region, sales, cost, regionRange, salesRange, costRange,
 LET(
     thisProfit, (sales - cost)/sales,
     regionAvg, RegionAvgProfit(region, salesRange, costRange),
     performance, IF(thisProfit > regionAvg, "Above Avg", "Below Avg"),
     performance
 )
)

We can name it PerformanceBand.

Now simply use:

=PerformanceBand([@Region], [@SalesValue], [@Cost], RegionColumn, SalesValueColumn, CostColumn)

And just like that, Excel classifies your stores dynamically.

No need for manual filters or pivots – just pure formula-driven intelligence.

It feels almost poetic when you realize Excel is thinking contextually now.


13. Let’s See This in Action

If you apply these formulas to our sample dataset, you might get something like this:

StoreRegionCategorySalesCostProfit %Region AvgPerformance
A101NorthElectronics240001800025.0%23.5%Above Avg
A102NorthFurniture160001200025.0%23.5%Above Avg
A103SouthElectronics300002200026.7%25.9%Above Avg
A104EastApparel180001100038.9%35.2%Above Avg
A105WestElectronics180001350025.0%25.8%Below Avg
A106SouthFurniture14000950032.1%25.9%Above Avg
A107NorthApparel210001300038.1%23.5%Above Avg
A108WestFurniture200001450027.5%25.8%Above Avg
A109SouthElectronics360002500030.6%25.9%Above Avg
A110EastApparel190001200036.8%35.2%Above Avg

You can already see the story forming.

Most stores are above their regional averages – but a few underperformers pop out naturally.

No pivot tables. No manual grouping.
Just pure function-driven logic.


14. From Static Data to Dynamic Storytelling

Here’s where I usually pause and smile.

For years, Excel was about formulas. Now, it’s about flow.

These Dynamic Array functions make your work tell a story — one that updates itself when the data changes.
Imagine refreshing your sales file, and instantly, every store’s performance band and regional benchmark update themselves in real time.

That’s not automation. That’s elegance.

I’ve seen analysts spend hours cleaning reports for Monday meetings. With this setup, they’d spend those hours thinking instead.


15. Layering LET for Reusability and Readability

Now that you’ve seen what’s possible, let’s build the final version of our key formula.

We’ll use LET to make it readable enough for a future you (or your colleague) to understand instantly.

=LET(
region, [@Region],
sales, [@SalesValue],
cost, [@Cost],
profit, sales - cost,
profitPct, profit / sales,
regionAvg, RegionAvgProfit(region, SalesValueColumn, CostColumn),
status, IF(profitPct > regionAvg, "Above Avg", "Below Avg"),
HSTACK(profit, profitPct, regionAvg, status)
)

This gives you all four insights in one go: Profit, Profit %, Region Avg, and Status.
Dynamic Arrays handle the spilling; LET handles the logic.

It’s clean, powerful, and understandable.

That’s the new Excel.


16. The Power of LAMBDA: True Custom Functions

If you’ve never created a named LAMBDA before, here’s how:

  1. Go to Formulas → Name Manager
  2. Click New
  3. Name it, say ProfitAnalysis
  4. Paste your LAMBDA formula
  5. Save

Then, across your workbook, you can just use:

=ProfitAnalysis([@Region], [@SalesValue], [@Cost], SalesValueColumn, CostColumn)

It’s modular, reusable, and professional.

Think of it as your personal Excel library.
You’re not just writing formulas anymore – you’re writing functions.


17. Why This Changes the Game

Here’s the human truth:
Most Excel models die not because they’re wrong, but because they’re unreadable.

A new analyst joins, opens the workbook, sees a 300-character formula, and silently closes it again.

LET and LAMBDA change that. They make your thought process visible.

When someone reads your LET formula, they can see the reasoning:

  • What’s defined
  • What’s calculated
  • What’s returned

And that, more than anything, is sustainable analytics.


18. Optional Add-on: Dynamic Dashboard Concept

You can use these functions to feed visuals dynamically:

  • Create a Data Validation list for Region.
  • Use the selected value in your RegionAvgProfit formula as an input.
  • Connect output arrays to charts like:
    • Profit % by Category
    • Above vs. Below Avg Stores
    • Trend of Regional Performance

Suddenly, your Excel dashboard breathes.
Change a slicer, and the logic reshapes automatically – thanks to Dynamic Arrays.


19. Personal Reflection

I’ll be honest – it took me years to unlearn the old Excel habits.

The obsession with helper columns, dragging formulas, and overengineering simple logic. But this new way of writing formulas feels closer to thinking.

LET and LAMBDA aren’t just features. They’re a mindset shift.

They turn formulas into thoughts that Excel can execute – cleanly and intelligently.

And that’s what makes it so rewarding.

Sometimes, when I build something like this, I catch myself smiling and whispering,
“Finally… Excel gets me.”


20. Closing Reflection

Maybe that’s the real evolution of Excel – not new buttons or ribbons, but a new way of thinking.
One where logic feels natural, formulas feel human, and complexity becomes beautiful again.

Because at the end of the day, Excel was never about cells. It was about clarity.


Discover more from The Insight Orbit

Subscribe to get the latest posts sent to your email.

Discover more from The Insight Orbit

Subscribe now to keep reading and get access to the full archive.

Continue reading