Arte SheetsLearn. Try. Understand.

Lookup & Reference

Copy Value from Every Nth Row or Column into a Clean Table (INDEX)

Reshape regular vertical blocks using INDEX and a stride, or extract every Nth column from a horizontal source. Includes explicit output anchors and bounds checks.

Start at the first output row, then advance by the block size

A2:A10 contains three complete blocks: company, city and revenue. C2 is the positive integer block height, initially 3. The first output row is row 2, so ROW(E2)-ROW($E$2) starts at zero. Using ROW(E2)-1 would incorrectly start at the second block.

Put the company formula in E2 and fill down through E4. Put the revenue formula in G2 and fill down through G4. The field offsets are 1 and 3 respectively. Data must have the same block structure throughout; missing lines cannot be inferred by a stride formula.

The formula reports End of source before INDEX runs past the source. It rejects invalid block sizes and field offsets exceeding the block height. It does not certify that source data is complete or correctly aligned.

First field: E2, filled down

The first result is Apex Corp, followed by Bolt Labs and Core Tech.

=IF(COUNT($C$2)<>1,"Enter numeric block size",IF(OR($C$2<1,$C$2<>INT($C$2)),"Block size must be a positive integer",IF(1>$C$2,"Field exceeds block size",LET(position,(ROW(E2)-ROW($E$2))*$C$2+1,IF(OR(position<1,position>ROWS($A$2:$A$10)),"End of source",INDEX($A$2:$A$10,position))))))

Third field: G2, filled down

The revenue sequence is 45000, 62000, 51000.

=IF(COUNT($C$2)<>1,"Enter numeric block size",IF(OR($C$2<1,$C$2<>INT($C$2)),"Block size must be a positive integer",IF(3>$C$2,"Field exceeds block size",LET(position,(ROW(E2)-ROW($E$2))*$C$2+3,IF(OR(position<1,position>ROWS($A$2:$A$10)),"End of source",INDEX($A$2:$A$10,position))))))

Horizontal source: every third column

A13:I13 repeats the same three-field records horizontally. Enter this formula in E6 and fill right to G6 to obtain the company names. The column argument of INDEX advances by the stride.

=IF(COUNT($C$2)<>1,"Enter numeric block size",IF(OR($C$2<1,$C$2<>INT($C$2)),"Block size must be a positive integer",IF(1>$C$2,"Field exceeds block size",LET(position,(COLUMN(E6)-COLUMN($E$6))*$C$2+1,IF(OR(position<1,position>COLUMNS($A$13:$I$13)),"End of source",INDEX($A$13:$I$13,1,position))))))

Try the example

Use the original values or change them to test your understanding.

Further reading