This procedure repeats a row a given, variable amount of times,
using reverse Pivot Table.
Assume your data and headers are arranged like this, starting at A1
Prod_ID Prod_NM Price Opt_Ref Prod_ID2
1 Prod1 10 18 1 0 0 12" 14" 16" 0 0 0 0 0
2 Prod2 15 25 2 0 0 0 0 0 Wt Blk Gry Crm Red
3 Prod3 5 18 3 0 0 12" 14" 16" 0 0 0 0 0
4 Prod4 20 7 4 Rd Bu 0 0 0 0 0 0 0 0
Opt_ref2 Opt_des2
7 Rd
7 Bu
18 12"
18 14"
18 16"
25 Wt
25 Blk
25 Gry
25 Crm
25 Red
Notice that column E is a repeat of A.
In F2:O2 enter this array formula:
=TRANSPOSE(IF(Opt_ref2=D2,Opt_des2,0))
and fill down.
Use reverse Pivot Table on E1:O5. See:
http://j-walk.com/ss/excel/usertips/tip068.htm
In the resulting Row/Column/Value table, insert 2 more blank Columns
and delete zeros with
Edit > Go To > Special > Constants > Numbers
(or Logicals if ,0 is omitted in the above formula)
Delete > Shift up > Entire Row
Fill the first row of the 3 blank columns with this array formula
with this format:
=VLOOKUP(......,A2

5,{2,3,4})
and fill down.