Convert 1 long single column into 2 columns for pr

2019-07-23 01:36发布

Basically I have a list of over 100,000 names that need to be printed. To save space I want them to display as 2 columns and can't seem to find an easy way to do this.

Currently:

1. A
2. B
3. C
4. D
5. E
6. F
7. G
8. H
9. I
10. J

What I want to do is:

1. A    6. F
2. B    7. G
3. C    8. H
4. D    9. I
5. E    10. J

I would also be OK with:

1. A    2. B
3. C    4. D
5. E    6. F
7. G    8. H
9. I    10. J

标签: excel
2条回答
爱情/是我丢掉的垃圾
2楼-- · 2019-07-23 02:20

If your data is in columns A and B, enter the below formula in column C fist row, drag it to right and then down,

=IF(ISODD(COLUMN()),INDEX($A:$A,ROW()*2-1,0),INDEX($A:$A,ROW()*2,0))

enter image description here

查看更多
祖国的老花朵
3楼-- · 2019-07-23 02:32

I was wondering if I could develop a fairly general solution to this.

Here is the formula for two columns

=IF(ROW()<=(COUNTA($A:$A)+3-COLUMNS($B:C))/2,INDEX($A:$A,COUNTIFS($B:B,"<>",$B:B,"<> ")+ROW())," ")

starting in column C

enter image description here

This may be changed to 3 columns by changing the constants

=IF(ROW()<=(COUNTA($A:$A)+4-COLUMNS($B:C))/3,INDEX($A:$A,COUNTIFS($B:B,"<>",$B:B,"<> ")+ROW())," ")

enter image description here

EDIT

Without the COUNTIFS which are a bit slow, the formulas are

=IF(ROW()<=(COUNTA($A:$A)+2-COLUMNS($B:B))/2,INDEX($A:$A,(COUNTA($A:$A)+3-COLUMNS($B:B))*(COLUMNS($B:B)-1)/2+ROW()),"")

and

=IF(ROW()<=(COUNTA($A:$A)+3-COLUMNS($B:B))/3,INDEX($A:$A,(COUNTA($A:$A)+4-COLUMNS($B:B))*(COLUMNS($B:B)-1)/3+ROW()),"")
查看更多
登录 后发表回答