How to implement multiple column repetition using formulas? Here is my
CodePudding user response:
try:
={OFFSET(A1:C;;;COUNTA(A1:A));
OFFSET(A1:C;;;COUNTA(A1:A));
OFFSET(A1:C;;;COUNTA(A1:A));
OFFSET(A1:C;;;COUNTA(A1:A));
OFFSET(A1:C;;;COUNTA(A1:A))}
CodePudding user response:
Another way, number of reps in D1, number of rows and columns in range to be copied can vary:
=ArrayFormula(vlookup(
mod(quotient(sequence(D1*rows(A1:C5),columns(A1:C5),0),columns(A1:C5)),rows(A1:C5)) 1,
{row(A1:C5),A1:C5},
mod(sequence(D1*rows(A1:C5),columns(A1:C5),0),columns(A1:C5)) 2))
For your locale:
=ArrayFormula(vlookup(
mod(quotient(sequence(P1*rows(A1:C5);columns(A1:C5);0);columns(A1:C5));rows(A1:C5)) 1;
{row(A1:C5)\A1:C5};
mod(sequence(P1*rows(A1:C5);columns(A1:C5);0);columns(A1:C5)) 2))