r/excel • • 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?

7 Upvotes

11 comments sorted by

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.

0

u/Repulsive_Tune9397 4d ago

I am beta channel, nested arrays support.

5

u/chiibosoil 431 4d ago

Might want to lead your post with that ;)

If it's beta why not give MSFT your feedback? It's why they use beta before it goes out to general release.

1

u/Repulsive_Tune9397 1d ago

I was wondering if that's expected or not to begin with, also I did lead with that in the post but you skim read it.

1

u/Way2trivial 475 4d ago

I mean, you just want 1212 right?

1

u/Repulsive_Tune9397 4d ago

Try ={SEQUENCE(2)} , if you have nested arrays support you will get a single cell who's contents are ={{1,2}}
now try to broadcast that cell using the if trick. it's not that I want this exact pattern but more more like questioning why broadcasting isn't working here.

1

u/Way2trivial 475 4d ago

if you wanna step it up

the 2 above defines the # of columns
the 7 the number of rows
and 1/7 must be 1/#of rows.

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/Repulsive_Tune9397 4d ago

This is exactly what I am trying to achieve but without the flatten part,
if you try =IF(SEQUENCE(2),1) The one will get repeated 2 times due to broadcasting, but if we try that on a nested structure who's size is also we get 2 #values errors.

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:

Fewer LettersMore Letters
IFSpecifies a logical test to perform
SEQUENCEOffice 365+: Generates a list of sequential numbers in an array, such as 1, 2, 3, 4
VALUEConverts a text argument to a number

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]