LASTUSEDCOLUMN returns the last column with an entry in the current sheet.
Excel Formula:
=LAMBDA(colFrom,
LET(c,IF(colFrom=0,16000,colFrom),
i,MAX((MOD(c,10^{1;2;3})=0)*{1;2;3}),
j,LOG(c),
k,(j<4)*(j=INT(j)),
x,0+(COUNTA(INDIRECT("C"&c&":C"&MIN(16384,c+(10^i)-1),FALSE))>0),
return,IF((x*(i=0))=1,c,LASTUSEDCOLUMN(c+(x*(10^i))-(10^(i-(x*i)-(k*(x=0)))))),
return)
)
Upvote
0