Friday, March 1, 2019

Excel combine two columns into one single column with values alternated

This answer worked great:

https://superuser.com/questions/539255/how-to-merge-two-excel-columns-into-one-the-other-way

In my case, since my data started at row 24 and I wanted first column first and second column second, I modified the top answer into the following:

=INDEX($A$24:$B$1000,QUOTIENT(ROW()-22,2),IF(MOD(ROW(),2)=0,1,2))

This uses the Index function, with source block, row number out of source block, column number out of source block. For some reason the row offset had to be -22 instead of -24 or even -23.

No comments: