Forum Discussion
MafazAnsar
Jun 23, 2022Copper Contributor
LAMBDA Bug - wrong output in array form
I created a LAMBDA function using Name manager which included an IF function to the GCD between the two input variables (one in the row & other in the column) and only to perform a calculation if the...
- Jun 23, 2022
For the first sample
it could be
TOE= LAMBDA( O, E, LET( fn, LAMBDA(O,E,IF(GCD(E,O)=1,E^2+O^2,0)), MAKEARRAY( ROWS(O), COLUMNS(E), LAMBDA(r,c, fn(INDEX(O,r), INDEX(E, c) )) ) ) )
SergeiBaklan
Jun 23, 2022Diamond Contributor
For the first sample
it could be
TOE=
LAMBDA( O, E,
LET(
fn, LAMBDA(O,E,IF(GCD(E,O)=1,E^2+O^2,0)),
MAKEARRAY( ROWS(O), COLUMNS(E),
LAMBDA(r,c, fn(INDEX(O,r), INDEX(E, c) ))
)
)
)