Excel: Merge two columns into one column with alte

2020-05-02 03:04发布

问题:

how can I merge two columns of data into one like the following:

Col1    Col2    Col3
========================
A       1       A
B       2       1
C       3       B
                2
                C
                3

回答1:

You can use the following formula in column D as per my example. Keep in mind to increase the $A$1:$B$6 range according to your data.

=INDEX($A$1:$B$6,INT((ROWS(D$2:D2)-1)/2)+1,MOD(ROWS(D$2:D2)-1,2)+1)

Result:



回答2:

Thank you to @Koby Douek for the answer. Just an addition--if you are using Open Office Calc, you replace the commas with semi-colons.

=INDEX($A$1:$B$6;INT((ROWS(D$2:D2)-1)/2)+1;MOD(ROWS(D$2:D2)-1;2)+1)