You are welcome! Thank you for your good words and have a nice day too!.

I'll try to explain, but forgive me for my poor English..

First we'll make formula a little simplier, like this.

=IF(H2="","",INDEX($C$1:C2,(MATCH(REPT("z",255),$C$1:C2)))&"-"&H2)

Formula like this
=INDEX(A:A,MATCH(REPT("z",255),A:A))

Finds the last text value in a range..In thIs case Column A, in our case, starting In C1, in EVERY cell of Column C.

What i mean is this.
We "Lock" cell C1 and as formula, goes down you see range to change like that...

$C$1:C2 This find from C1:C2

$C$1:C3 This find from C1:C3

$C$1:C4 This find from C1:C4

ETC ETC.....

Hope to helps you.