https://bugs.documentfoundation.org/show_bug.cgi?id=174180
--- Comment #4 from [email protected] --- I can write expressions of extreme complexity even without LET at all. Now, if that happens to be such a big issue to work on this for failure of seeing why nested LETs could be useful, so be it. I'm not planning on arguing to validate my opinion that it would be useful. This will just be a bad point for Calc, and Calc may still be useful to me even with this bad point. I tried to bring forward the simplest cases of failure, and receiving easy solutions for my silly examples is not useful one bit. Here's a formula that "solved" one of the cases where I would have enjoyed nested LETs (I wouldn't go so far as to say I'm happy with it, but it works). Having nested LET would have avoided having "MATCH(A3, 'Calc Affine'.$AN:$AN, 0)" calculated twice, for example. =IF(COUNTA(A3:C3)<>3, NA(), IF(ISNA(MATCH(A3, 'Calc Affine'.$AN:$AN, 0)), NA(), IF(INDEX('Calc Affine'.$AW:$AW, MATCH(A3, 'Calc Affine'.$AN:$AN, 0))=0, HSTACK(A3,NA()), LET(mxrw, MATCH(A3, 'Calc Affine'.$AN:$AN, 0), sgcnt, INDEX('Calc Affine'.$AW:$AW, mxrw), sgcol, INDEX('Calc Affine'.$AV:$AV, mxrw), all,'UTM Seg'.$A:$CAA, LL, INDEX(all,SEQUENCE(sgcnt-2,,3),sgcol), Ax, INDEX(all,SEQUENCE(sgcnt-2,,3),sgcol+2), Ay, INDEX(all,SEQUENCE(sgcnt-2,,3),sgcol+3), Bx, INDEX(all,SEQUENCE(sgcnt-2,,3),sgcol+4), By, INDEX(all,SEQUENCE(sgcnt-2,,3),sgcol+5), dx, Bx-Ax, dy, By-Ay, denom, dx*dx+dy*dy, p,IF(denom=0,0,(($B3-Ax)*dx+($C3-Ay)*dy)/denom), τ,IF(denom=0,0,IF(p<0,0,IF(p>1,1,p))), disq,($B3-Ax-τ*dx)^2+($C3-Ay-τ*dy)^2, disn,MIN(disq), disx,MATCH(disn,disq,0), tmx,INDEX(INDEX(all,SEQUENCE(sgcnt-2,,3),sgcol+6),disx), Line,INDEX(LL,disx), nmxrw, MATCH(tmx, 'Calc Affine'.$AN:$AN, 0), ans, HSTACK(tmx,Line,SQRT(disn),mxrw, nmxrw), ans)))) Might as well close the bug as irrelevant now... I spent a lovely afternoon trying to participate in this otherwise interesting project that is Calc. I suppose my best approach was the one I had up to this afternoon, just take the application and shut up. Cheers! -- You are receiving this mail because: You are the assignee for the bug.
