If you have a source table called "datatable", put this formula on an extra sheet into every cell (where the printed data should appear):

```
=OFFSET(datatable!$A$2;(ROW()-2)+((COLUMN()-1-MOD(COLUMN()-1;3))/3*4);MOD(COLUMN()-1;3))
```

(*the above is translated from german into english. The tested german formula is:* `=BEREICH.VERSCHIEBEN(datatable!$A$2;(ZEILE()-2)+((SPALTE()-1-REST(SPALTE()-1;3))/3*4);REST(SPALTE()-1;3))`

)

# expected result:

This will transform the content of the sheet "datatable":

```
A1 B1 C1
A2 B2 C2
A3 B3 C3
A4 B4 C4
A5 B5 C5
A6 B6 C6
...
```

into:

```
A1 B1 C1 A5 B5 C5 ...
A2 B2 C2 A6 B6 C6 ...
A3 B3 C3 ...
A4 B4 C4 ...
```

# Explanation:

## Basics:

e.g. `OFFSET( datatable!$A$2; 3; 4 )`

references the cell relative to `$A$2`

, 3 rows down, 4 columns to the right.

`ROW()`

and `COLUMN()`

are numbers, representing the position of the current cell in the current sheet (e.g. `$A$1`

= column 1/row 1, `$C$2`

= column 3/row 2).

The `(-1)`

everywhere are necessary because we are using offsets, and the first row and column is 1, but we want the first referenced cell to be `$A$2`

, not `$A$2`

plus offset 1.

The `(ROW()-2)`

is for a headline in the output-/print-table (It shold be -1 if you don't have a headline).

`$A$2`

is for a headline in the source "datatable". Without headline it should be referenced with `$A$1`

(instead of `$A$2`

).

## Details:

The 3rd parameter `OFFSET(...;...;MOD(COLUMN()-1;3))`

is the **column offset**, it will always reference one of the first 3 columns of the source "datatable".

That is `$A$2`

plus column offset 0, 1, 2, 0, 1, 2, 0, 1, 2, ...

In the 2nd parameter `OFFSET(...; (ROW()-2) + ((COLUMN()-1-MOD(COLUMN()-1;3))/3*4) ;...)`

selects the **row offset**.

Basically the math here is y + x * 4.

4 is the number of rows you want to display.

3 is the number of colums in the source "datatable".

The x is made of the column and modulo 3.

`COLUMN()-1`

is 0, 1, 2, 3, ... and so on.

`MOD(COLUMN()-1;3)`

will be 0, 1, 2, 0, 1, 2, 0, 1, 2, ...

`COLUMN()-1-MOD(COLUMN()-1;3)`

will be 0, 3, 6, 9, ... and so on, where the value is changing only every 3rd column.

Division by 3 will result in 0, 1, 2, 3, ...

Multiplication with 4 will result in 0, 4, 8, 12, ...

(For explaination about *Modulo*, see also `MOD()`

in the excel help, or modulo operation in wikipedia)

*(Thanks to Jake Kacher, for the basic idea)*