Forum Discussion
SergeiBaklan
Jan 22, 2022Diamond Contributor
long texts with arrays in conditional functions
PeterBartholomew1 , tboulden or someone else
Perhaps you know the workaround, even with lambdas. In simplest case
=IF( 1, REPT("a", 256) ) works
=IF( {1}, REPT("a", 256) ) returns #VALUE!
...
SergeiBaklan
Jan 22, 2022Diamond Contributor
In general it works with MAP()
=LET( t, FILTER(range, criteria), MAP( t, LAMBDA(v, IF( v= "", "", v) ) ) )
or back to simplest case
=LET( arr, {1}, MAP( arr, LAMBDA(v, IF( v, REPT("a", 256) ) ) ) )
Perhaps shorter solution?
tboulden
Jan 22, 2022Iron Contributor
Sergei, you honor me with thinking I can be of help 🙂 However, if I understand the problem correctly, I think you're on the right track with MAP, and I'd venture that MAP vs BYROW internal workings exemplify the issue between your examples using 1 vs {1}. Assuming single column array for arr, I think MAP takes the value from each row-cell, however BYROW takes each row-cell as an array.
- SergeiBaklanJan 23, 2022Diamond Contributor
Thank you. Not sure about BYROW(), will play with it. MAKEARRAY() works, but formulas are so ugly...
- tbouldenJan 23, 2022Iron ContributorAgreed, I suspected MAKEARRAY would be viable also, but I agree with you that the formulae are ugly and unwieldy.