-2

After a Google search, I learned that the following function (or rather, blending of functions) stacks existing columns: =OFFSET($A$1,MOD(ROW()-ROW($CL$1),ROWS($A$1:$A$281)),TRUNC((ROW()-ROW($CL$1))/ROWS($A$1:$A$281)),1,1)

I'd like to know what each part of that formula does. For starters, I've never seen MOD used like that, and I can't tell if the "-" indicates a minus sign or range. The formula works though so clearly whoever wrote it knew what they were doing.

1 Answers1

0

Whoah. At first I thought this was insanity but this makes sense!

I'll leave the definitions of each function to you to read the documentation, but here's how it's put together:

For the first 281 rows, it's equivalent to the same value in the A row, because it equates to =OFFSET($A$1, ROW() - 1, 0) for each row. (OFFSET's fourth and fifth arguments are 1 and 1 by default.)

Then, for the next 281 rows, the second parameter of OFFSET starts over at 0, and the third parameter is TRUNC((ROW() - 1)/ 281) i.e. 1, so now it's equivalent to =OFFSET($A$1, ROW() - 282, 1). So it starts with getting the value of B1 and then goes down.

Then, for the next 281 rows, =OFFSET($A$1, ROW() - 563, 2.

Keep extending that formula down enough rows, and it will be a single column containing every value in row A, then every value in row b, then every value in row C, etc.

JSmart523
  • 2,069
  • 1
  • 7
  • 17