'Automatic numbering in Excel with hierarchy

I would like to do an automatic summary numbering. The only thing we could do is to number the A's (the titles) but the subtitles should be numbered automatically. If the title = 1, subtitle 1.1, below 1.1.1 and so on.

Let's say the titles are A, B and C are subtibles.

The pattern should be like this

1.A

1.1 B

1.2 B

2.A

2.1 B

2.1.1 C

So I tried this : https://stackoverflow.com/a/32321112/7968011

What I get

What we want

What we want



Solution 1:[1]

Fast and dirty.

Just enter the first section manualy.
Then insert it below:

=IF(A3="down",B2&"1.",IF(A3="up",LEFT(B2,LEN(B2)-4)&MID(B2,LEN(B2)-3,1)+1&".",LEFT(B2,LEN(B2)-2)&MID(B2,LEN(B2)-1,1)+1&"."))

When you write "down" it will add "1." in the end of the string above.
When you write "up" it will remove the last 2 chars and add 1 to the last char of the string above.
if you dont write nothing it will add 1 to the last char.

bug: "up" will not work if section is > 9.

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jeremy Caney