I have a problem that I haven\'t been able to find anywhere on the web (it may be there, but I can\'t find it, heh).
I have a spreadsheet with 13 columns of data. E
Solution based on my second comment. This example assumes you have three columns of data but can be adapted to handle more.
I start with your sample data. I added counts on the top row for convenience. I also added the total number of combinations (product of the counts). This is Sheet1:

On Sheet2:

Formulae:
A2:C2 (orange cells) are hard coded =0
A3=IF(SUM(B3:C3)=0,MOD(A2+1,Sheet1!$E$1),A2)
B3=IF(C3=0,MOD(B2+1,Sheet1!$G$1),B2)
C3=MOD(C2+1,Sheet1!$J$1)
D2=INDEX(Sheet1!$E$2:$E$5,Sheet2!A2+1)
E2=INDEX(Sheet1!$G$2:$G$6,Sheet2!B2+1)
F2=INDEX(Sheet1!$J$2:$J$5,Sheet2!C2+1)
Fill from row 3 down as many rows as Total shows on Sheet1