Forum Discussion
ecovonrein
Feb 08, 2025Iron Contributor
Degenerate MAP blows up Excel
Does this formula work for you?
=MAP(0,1,LAMBDA(x,y,x+y))
Which Build are you on? I am stuck on 2406 because all Builds since blow up when running my spreadsheets - which, as I type this, JUST MIGHT be down to this nonsense.
Not only does this innocent instruction return #VALUE!, it also appears to corrupt Excel beyond recovery. Which is a problem because the MAP(LAMBDA( phrase is a wrap one needs to deploy when a Lambda(a,b... might have to handle vectors for a and b to return a vector of results for a computation that will not support such vector inputs natively.
The cure for this nonsense on my Build appears to be
=MAP(HSTACK(0),HSTACK(1),LAMBDA(x,y,x+y))
Unfortunately, it is hard to remember this. I might have to scour my Lambdas.
The problem only appears to concern MAPs with multiple vectors.
=MAP(1,LAMBDA(x,x))
is just fine.
MAP requires arrays as parameters. In many cases auto-lifting from scalar to array works in Excel, but not always. That's not only with two-arrays MAP, in some other cases as well. And nobody promised auto-lifting shall always work. Thus, where needed we may use explicit conversion, e.g. in case of constants
=MAP( {0}, {1}, LAMBDA(x,y, x+y))
works. Auto-lifting from ranges to arrays in such formula works implicitly, e.g.
=MAP( A1, A2, LAMBDA(x,y, x+y))
works.
By the way, not sure on which Excel you are. Build number could say something for perpetual license. For the subscription model build number actually doesn't matter, more important on which channel you are.