The question may be simple but the formula is complicated:

In a cell in row 1, enter the following **array formula**, confirmed with
**Ctrl+Shift+Enter**(this is essential):

=IFERROR(INDEX($A$1:$B$6, SMALL(IF($B$1:$B$6>0, MATCH(ROW($A$1:$A$6), ROW($A$1:$A$6)), ""), ROWS($A$1:$A1)), COLUMNS($A$1:A$1)), "")

Fill to the right to the next column, then fill down as far as you want.

Regards, Hans Vogelaar (http://www.eileenslounge.com)