Hi

In G2, put this ARRAY(Confirm, using Control+Shift+Enter. Not Just Enter), formula.

=IFERROR(INDEX(A$2:A$20,SMALL(IF(A$2:A$20<>0,ROW(A$2:A$20)-1),ROW(A1))),"")

Copy down and across(to the right).