In C1: 24
In C2: 31

In C3 and copied down

=if(rows(c$3:c3)<=$c$2,$c$1&" of "&rows(c$3:c3),"")

is it what you are looking for ?