r/excel • u/Repulsive_Tune9397 • 4d ago
Discussion Why doesn’t a nested array broadcast in IF, but a thunk does?
We all know the neat trick of broadcasting with an IF condition: =IF(SEQUENCE(2),1) stretches the scalar across both rows.
I wanted to use it with Excel’s new nested array support, to get an outer array of size 2 where each element holds an inner array. But it unexpectedly returns #VALUE! errors:
=IF(SEQUENCE(2),{SEQUENCE(,2)})There is a workaround: the old thunk technique. Wrapping the inner array in a LAMBDA makes it behave as a scalar, so it broadcasts:
=IF(SEQUENCE(2), LAMBDA(SEQUENCE(5)))The catch is that you then have to evaluate the thunks with an iterator like MAP or REDUCE, so it feels a bit like a loophole. Not sure about it's efficiency either.
Is the #VALUE! error expected in the first place?
2
u/chiibosoil 431 4d ago
Yes it is expected. AFAIK, everything nested in {} syntax is treated as literal and does not evaluate formula.
Not sure how you are even getting #VALUE error with first formula. In my test, it won't even allow me to enter the formula.
If you use literal array {1, 2} instead of SEQUENCE() inside {} it will evaluate and expand as expected.
1
u/Way2trivial 475 4d ago
I mean, you just want 1212 right?
1
u/CorndoggerYYC 162 4d ago
I'm probably misunderstanding what you're trying to do, but what about this?
={IF(SEQUENCE(2),FLATTEN({SEQUENCE(2)}, "",1))}
1
u/Decronym 4d ago edited 1d ago
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:
Decronym is now also available on Lemmy! Requests for support and new installations should be directed to the Contact address below.
Beep-boop, I am a helper bot. Please do not verify me as a solution.
3 acronyms in this thread; the most compressed thread commented on today has 10 acronyms.
[Thread #49719 for this sub, first seen 20th Nov 2026, 15:48] [FAQ] [Full list] ^[Contact] [Source code]