Forum Discussion
Need help building a numbering formula
- Apr 03, 2024
=LET(rng,H3:K23,
numbering,DROP(
REDUCE("",SEQUENCE(,COLUMNS(rng)),LAMBDA(a,b,
LET(
z,IF(b=1,0,COUNT(CHOOSECOLS(rng,SEQUENCE(,b-1,1,1)))),
HSTACK(
a,
REDUCE("",SEQUENCE(ROWS(rng)),LAMBDA(u,v,
VSTACK(u,IF(INDEX(rng,v,b)="","",z+COUNT(INDEX(rng,1,b):INDEX(rng,v,b))))))))))
,1,1),
"INPUT "&BYROW(numbering,LAMBDA(r,FILTER(r,r<>""))))
This formula returns the intended result in my sheet. However it only works in Office 365 and Excel for the web.
For verification i've applied the formula for range M3:P23 and it returns the expected result.
=LET(rng,H3:K23,
numbering,DROP(
REDUCE("",SEQUENCE(,COLUMNS(rng)),LAMBDA(a,b,
LET(
z,IF(b=1,0,COUNT(CHOOSECOLS(rng,SEQUENCE(,b-1,1,1)))),
HSTACK(
a,
REDUCE("",SEQUENCE(ROWS(rng)),LAMBDA(u,v,
VSTACK(u,IF(INDEX(rng,v,b)="","",z+COUNT(INDEX(rng,1,b):INDEX(rng,v,b))))))))))
,1,1),
"INPUT "&BYROW(numbering,LAMBDA(r,FILTER(r,r<>""))))
This formula returns the intended result in my sheet. However it only works in Office 365 and Excel for the web.
For verification i've applied the formula for range M3:P23 and it returns the expected result.
- mb454316Apr 03, 2024Copper ContributorThank you! I did have a formula for the MPPT column, but thanks!