简体   繁体   English

如何根据EXCEL中的条件将一列分为两列

[英]how to split one column into two columns base on conditions in EXCEL

I am very new to Excel. 我对Excel非常陌生。 Please help 请帮忙

Column1
A,1
B,2
C,1
D,2
E,1

output: 输出:

Column2  Column3
A,1       B,2
C,1       D,2
E,1

what is the formula to do this? 这样做的公式是什么? Thanks! 谢谢!

Assuming your data (" A,1 , etc.") spans cells A1:A50, then: 假设您的数据(“ A,1等”)跨越单元格A1:A50,则:

Cell B1: =INDEX($A$1:$A$50,ROW()*2-1,1) 单元格B1: =INDEX($A$1:$A$50,ROW()*2-1,1)

Cell C1: =INDEX($A$1:$A$50,ROW()*2,1) 单元格C1: =INDEX($A$1:$A$50,ROW()*2,1)

Then you can copy the formulas to cells below, as far as needed. 然后,您可以根据需要将公式复制到下面的单元格中。 These formulas "redistribute" your cells contents between the two columns, regardless of the text itself. 无论文本本身如何,这些公式都会在两列之间“重新分配”单元格内容。

You can use an IF condition like this as well 您也可以使用这样的IF条件

    =IF(RIGHT(A2,1)="1",A2,"") in column 2
=IF(RIGHT(A2,1)="2",A2,"") in column 3

However cells cannot be deleted just with formula 但是,不能仅使用公式删除单元格

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM