Forum Discussion
boukasa
Nov 26, 2025Brass Contributor
How does Excel calculate named formulas and materialized named ranges?
I have been creating utility formulas with AFE to make my lambdas more readable and maintainable, for example: ManualAllocRng =OFFSET(ManualAllocCorner,1,0,URows,EntityCount); How does Excel calcul...
Patrick2788
Nov 29, 2025Silver Contributor
Excel favors eager evaluation in most situations. In your two examples, the timings were about the same. The example using trim range was the quickest.
ManualAllocRng =
OFFSET(Sheet1!$A$1,0,0,COUNTA(Sheet1!$A:$A),5);
// Average of 5 timings
// Elements 1.25 million
// TestAλ 0.21
// TestBλ 0.21
// TestCλ 0.18
TestAλ =
LAMBDA(
x,
LET(
rng, ManualAllocRng,
a, DROP(rng,,2),
b, TAKE(rng,,-2),
result, HSTACK(a,b)+x,
result
));
TestBλ =
LAMBDA(
x,
LET(
a, DROP(ManualAllocRng,,2),
b, TAKE(ManualAllocRng,,-2),
result, HSTACK(a,b)+x,
result
));
TestCλ=
LAMBDA(
x,
LET(
rng, Sheet1!$A:.$E,
a, DROP(rng,,2),
b, TAKE(rng,,-2),
result, HSTACK(a,b)+x,
result))The way in which the first two examples are authored may have an effect on the calculation speed, but it really depends on what you're doing with the arrays. Excel seems to prioritize allocating memory to spill re-sizing but it's not easy to re-produce the situation. I've seen functions take 12 seconds to calculate even with the function terminating within an IF even before the LET block comes in. There are ways to stop the eager evaluation and even speed up functions with some well-placed thunks. In the examples A/B above, there were no differences in the calc speed.