View Single Post
  #6   Report Post  
Harlan Grove
 
Posts: n/a
Default

Alan Beban wrote...
The second formula I previously provided was hard coded to the extent
that it assumed column headings in Cells B1:D1 in the form of Series

1,
Series 2, Series 3; The second formula in the following set of 3
formulas for F2, G2 and H2, respectively, does not have this

limitation;
when copied down it simply retuns the headings from B1:D1, whatever

they
a

=OFFSET($A$2,ROW(A1)-1-INT((ROW(A1)-1)/(COUNTA(A:A)-1))*(COUNTA(A:A)-1),0)

=OFFSET($B$1,0,INT((ROW(A1)-1)/(COUNTA(A:A)-1)))

=OFFSET($B$2,ROW(A1)-1-INT((ROW(A1)-1)/(COUNTA(A:A)-1))
*(COUNTA(A:A)-1),INT((ROW(A1)-1)/(COUNTA(A:A)-1)))

....

Your formulas also assume that there's nothing below the data in column
A.
That's unwise. Better to give the original data including the top row
containing the series names a defined name like Orig, then use formulas
like the following (assumes top-left result cell is F2).

F2:
=OFFSET(Orig,MOD(ROW()-ROW($F$2),ROWS(Orig)-1)+1,0,1,1)

G2:
=OFFSET(Orig,0,INT((ROW()-ROW($F$2))/(ROWS(Orig)-1))+1,1,1)

H2:
=OFFSET(Orig,MOD(ROW()-ROW($F$2),ROWS(Orig)-1)+1,
INT((ROW()-ROW($F$2))/(ROWS(Orig)-1))+1,1,1)

Then fill F2:H2 down as far as needed. Another advantage to these
formulas
is that they only refer to cells in Orig and cells in the result range
(actually just to F2), which means you can move the result range
anywhere
and the formulas will automatically adjust correctly. Alan's formulas
only
work if the top row of the result range is row 2 in the worksheet.