View Single Post
  #13   Report Post  
Posted to microsoft.public.excel.misc
AirBoss AirBoss is offline
external usenet poster
 
Posts: 7
Default Merge data rows at fixed ratio

Terrific! Thanks, Max.

I'll see if I can pivot off your work to develop a generic X:Y ratio
merge.

- AB


Max wrote:
Here's a refinement for the formulas in cols B & C
(a much shorter version using SUMPRODUCT):

Put instead in B1:
=IF(AND($A10,$A1<7),OFFSET(A!$A$1,SUMPRODUCT(--($A$1:$A1={1,2,3,4,5,6}))-1,COLUMN(A1)-1),OFFSET(B!$A$1,SUMPRODUCT(--($A$1:$A1={0,7,8,9,10}))-1,COLUMN(A1)-1))

Copy B1 to C1. Then select A1:C1, copy down as far as required (copy
down by
the total number of rows from "A" and "B"). Hide away col A. Cols B and
C
will return the merged data rows from sheets: "A" & "B" intermingled in
the
desired ratio of 6:5.

Revised sample for the above is available at:
http://www.savefile.com/files/347409
Merge data rows fr 2 shts at fixed ratio (6 to 5)_v2.xls
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---