For my data, a block constitutes of 60 rows. Following a block, there's a row that either has a value of 1 or 2. However, this row does not appear after EVERY block, there are a few blocks that are just back to back. There is another column called "test_name", the value of this column for the blocks are "block" and the value of this column for the single rows following blocks are "question".
The value of the row following a block is either 1 or 2. For the preceding block, I would like to create a new column that adds the same value of the following row.
e.g. row following block 1 has the value "1", so input value "1" for all of block 1 in the new column, while the row following block 2 has a value of "2" so input value "2" for all of block 1, there's no row following block 3 so skip, the row following block 4 has a value of "2" so values in the new column of block 4 should be "2".
Row of 60 - single row w/ 1 value (1 or 2) - row of 60 - row of 60 - single row w/ value of 1 or 2, etc.
This is at random, there's no discernible pattern from what I could see. I hope this makes sense!
I was wondering if its possible to reference whenever this specific row appears and the value it has (maybe through "IF" (?)) and then add a value to the preceding 60 rows with the value it has in a new column?
If you need extra information or clarification, please ask. Thanks for any help in advance!