excel按名字拆分文件
If you have a list of names in Excel, with first and last names separated by a comma, you can use an Excel feature to split first and last names into separate columns.
如果您在Excel中有一个名称列表,名字和姓氏之间用逗号隔开,则可以使用Excel功能将名字和姓氏分成单独的列。
选择清单 (Select the List)
To start, select the cells that contain the names.
首先,选择包含名称的单元格。
On the Ribbon in Excel 2007, click the Data tab, then click Text to Columns.
在Excel 2007中的功能区上,单击“数据”选项卡,然后单击“文本到列”。
If you're using an earlier version of Excel, click the Data menu, then click Text to Columns.
如果您使用的是早期版本的Excel,请单击“数据”菜单,然后单击“文本到列”。
将文本转换为列向导 (The Convert Text To Columns Wizard)
The Convert Text to Columns Wizard opens, and you can select the type of data that you want to convert.
将打开“将文本转换为列”向导,您可以选择要转换的数据类型。
Note: The wizard layout varies slightly in different versions of Excel, but the steps are the same.
注意:在不同版本的Excel中,向导的布局略有不同,但是步骤相同。
- The list in this example uses a comma to separate the names, so select Delimited, then click Next. 本示例中的列表使用逗号分隔名称,因此选择“定界”,然后单击“下一步”。
- Next, add a check mark to the delimiter that's used in your text. You can select more than one, but in this example only Comma is required. We only want to split first and last names were the comma is inserted. 接下来,在文本中使用的定界符上添加一个复选标记。 您可以选择多个,但在此示例中,仅需要逗号。 我们只想在插入逗号时拆分名字和姓氏。
- Click Next, to go to Step 3. 单击下一步,转到步骤3。
- Select a destination cell, where you want the split text to start. The default setting is to overwrite the existing data, so if you want to keep it, select a different cell as the destination. 选择一个目标单元格,您要在其中开始拆分文本。 默认设置是覆盖现有数据,因此,如果要保留它,请选择其他单元格作为目标。
- Click Finish, and the data is split into separate columns. 单击“完成”,数据被拆分为单独的列。
其他分割数据的方法 (Other Methods For Splitting Data)
This method is quick and easy, and perfect for a one time event, such as importing a list of names, and splitting it.
此方法快速简便,并且非常适合一次性事件,例如导入名称列表并将其拆分。
However, if the names will change frequently, you could use a formula to split the names, instead of the Text to Columns feature. Then the first and last name columns will automatically update, if the full name changes.
但是,如果名称经常更改,则可以使用公式来拆分名称,而不是使用“文本到列”功能。 然后,如果全名更改,名字和姓氏列将自动更新。
Chip Pearson has sample formulas for Extracting First and Last Names, and VBA code for splitting data. ________________________
Chip Pearson有用于提取名字和姓氏的示例公式,以及用于拆分数据的VBA代码。 ________________________
翻译自: https://contexturesblog.com/archives/2009/03/26/split-first-and-last-names-in-excel/
excel按名字拆分文件