Forum Discussion

MafazAnsar's avatar
MafazAnsar
Copper Contributor
Jun 23, 2022
Solved

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...
  • SergeiBaklan's avatar
    Jun 23, 2022

    MafazAnsar 

    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) ))
            )
        )
    )

Resources