Multi-level Numbering in Excel

Viewed 57

I have the following excel file enter image description here

The user will enter the number of the levels (3 levels in the example) then using sequence function it will be showed in the level columns colored light blue automatically. Then, the user should enter the sub-clause next to each level. My desired outcome is I would like the Level & Sub-Clause 1 column to be filled with the following list based on the user entry as mentioned before:

  • 1
  • 1.1
  • 2
  • 2.1
  • 2.2
  • 2.3
  • 3
  • 3.1
  • 3.2

is it possible?

2 Answers

With TOCOL,MAKEARRAY inside a LET with FILTER to remove the blanks:

=LET(
    r,B1,
    l,B4#,
    sc,C4:INDEX(C:C,4+r-1),
    cl,TOCOL(MAKEARRAY(r,MAX(sc+1),LAMBDA(a,b,IF(b=1,INDEX(l,a),IF(b-1>INDEX(sc,a),"",INDEX(l,a)&"."&b-1)))),3),
    FILTER(cl,cl<>""))

enter image description here

=TEXTSPLIT(TEXTJOIN("-",,BYROW(B6:INDEX(C:C,MAX(ROW(B6#))),LAMBDA(br,TEXTJOIN("-",,INDEX(br,,1),INDEX(br,,1)&"."&SEQUENCE(INDEX(br,,2)))))),,"-")

enter image description here

Edit: forgot about the single level at first. Updated the formula and screenshot to include it.

Related