Moving contents of every other row up a row and one column to the right

Copper Contributor

I have a large table where the data was incorrectly stored. I need to move the data from the even rows up one row and to the right one column and then delete the empty rows. Is there a way to do this programmatically? Example: Cell (1,1) and (2,1) needs to be Cell (1,1) (Unchanged) and (1,2) then deleting row 2.

3 Replies

@EmethAlethia 

You can try a solution with Power Query. In the attached file you can add data to the blue dynamic table. Then you can click in any cell of the green table and right-click with the mouse and select refresh to update the green result table.

Moving contents of every other row up.JPG

@EmethAlethia 

 

If you're looking to do this:

Patrick2788_0-1685632476077.png

You could use:

=WRAPROWS(vector,2)

 

If you need this:

Patrick2788_1-1685632807271.png

Then go with this:

=LET(
    r, ROWS(vector),
    seq, SEQUENCE(r / 2, , 1, 2),
    INDEX(vector, seq) & " " & INDEX(vector, seq + 1)
)

 

@EmethAlethia 

Power Query alternative attached (Thanks @OliverScheurich for the "template")