sqlserver中将多列_如何在Excel中将一个长列变成多个列

sqlserver中将多列_如何在Excel中将一个长列变成多个列

sqlserver中将多列

sqlserver中将多列_如何在Excel中将一个长列变成多个列

Too much data in a single column can make your Microsoft Excel spreadsheet harder to read. To improve it, you should consider splitting up your column using the “Text to Columns” or “Flash Fill” features.

单列中的数据过多会使您的Microsoft Excel电子表格难以阅读。 为了改进它,您应该考虑使用“文本到列”或“快速填充”功能拆分列。

“Text to Columns” will replace your single column with multiple columns using the same data. “Flash Fill” will replicate the data, splitting it into new, individual columns while leaving the original column intact.

“文本到列”将使用相同的数据将您的单个列替换为多个列。 “ Flash Fill”将复制数据,将其拆分为新的单个列,同时保持原始列不变。

如何在Excel中使用文本到列 (How to Use Text to Columns in Excel)

Microsoft Excel includes a special feature that allows you to split up extra long columns. It does this by separating columns using delimiters, like commas or semicolons, which split up the data.

Microsoft Excel包含一项特殊功能,可让您拆分额外的长列。 它通过使用分隔符(例如逗号或分号)分隔列来完成此操作,分隔符用于分隔数据。

The feature works by using Text to Columns, which you can access from the “Data” tab in your Microsoft Excel ribbon bar.

该功能通过使用“ 文本到列”来工作 ,您可以从Microsoft Excel功能区栏中的“数据”选项卡中访问它。

To test this feature, we’ll be using a set of data (an employee list, showing names, dates of birth, and other information) in a single column. Each section of data is in a single cell, separated by a semicolon.

为了测试此功能,我们将在单个列中使用一组数据(员工列表,显示姓名,出生日期和其他信息)。 数据的每个部分位于单个单元格中,以分号分隔。

sqlserver中将多列_如何在Excel中将一个长列变成多个列

You’ll need to select the cells containing your data first (cells A1 to A12 in the example above).

您需要首先选择包含数据的单元格(在上面的示例中,单元格A1至A12)。

From Excel’s “Data” tab, click the “Text to Columns” button found in the “Data Tools” section.

从Excel的“数据”选项卡中,单击“数据工具”部分中的“文本到列”按钮。

sqlserver中将多列_如何在Excel中将一个长列变成多个列

This will bring up the “Convert Text to Columns Wizard” window and allows you to begin separating your data. From the options, select the “Delimited” radio button and click “Next” to continue.

这将打开“将文本转换为列向导”窗口,并允许您开始分离数据。 从选项中,选择“定界”单选按钮,然后单击“下一步”继续。

sqlserver中将多列_如何在Excel中将一个长列变成多个列

By default, Excel will choose to try and separate your single column data by each tab it finds. This is fine, but for our example, we’re using data that’s separated by semicolons.

默认情况下,Excel将选择尝试通过找到的每个选项卡来分隔单列数据。 很好,但是对于我们的示例,我们使用的是用分号分隔的数据。

Choose your delimiter option from the side menu. For our example, our chosen delimiter is a semicolon.

从侧面菜单中选择定界符选项。 对于我们的示例,我们选择的定界符是分号。

sqlserver中将多列_如何在Excel中将一个长列变成多个列

You can see how the converted data will look in the “Data Preview” section at the bottom of the menu.

您可以在菜单底部的“数据预览”部分中查看转换后的数据的外观。

Once you’re ready, click “Next” to continue.

准备就绪后,单击“下一步”继续。

sqlserver中将多列_如何在Excel中将一个长列变成多个列

You’ll now need to set the cell types for each column. For instance, if you have a column with dates, you can set the appropriate date format for that column. By default, each column will be set to the “General” setting.

现在,您需要为每列设置单元格类型。 例如,如果您有一列带有日期的列,则可以为该列设置适当的日期格式。 默认情况下,每列将设置为“常规”设置。

Using this option, Excel will attempt to set the data type for each column automatically. To set these manually, click on your column in the “Data Preview” section first. From there, select the appropriate data type from the “Column Data Format” section.

使用此选项,Excel将尝试自动设置每一列的数据类型。 要手动设置这些设置,请首先单击“数据预览”部分中的列。 在此处,从“列数据格式”部分中选择适当的数据类型。

If you want to skip a column completely, select your column, then choose the “Do Not Import Column (Skip)” option. Click “Finish” to begin the conversion.

如果要完全跳过一列,请选择您的列,然后选择“不导入列(跳过)”选项。 单击“完成”开始转换。

sqlserver中将多列_如何在Excel中将一个长列变成多个列

Your single column will separate each section, using the delimiters, into individual columns using the cell formatting options you selected.

您的单列将使用定界符将每个部分使用选定的单元格格式设置分隔为单独的列。

sqlserver中将多列_如何在Excel中将一个长列变成多个列

如何在Excel中使用Flash Fill (How to Use Flash Fill in Excel)

If you’d like to keep your original data intact, but still separate the data, you can use the “Flash Fill” feature instead.

如果您希望保持原始数据不变,但仍将数据分开,则可以使用“ Flash Fill”功能。

Using our employee list example, we have a single column (column A) header row, with a semicolon delimiter separating each bit of data.

使用我们的员工列表示例,我们有一个单列(A列)标题行,并用分号分隔符分隔数据的每一位。

sqlserver中将多列_如何在Excel中将一个长列变成多个列

To use the “Flash Fill” feature, start by typing out the column headers in row 1. For our example, “Employee ID” would go in cell B1, “First Name” in cell C1, etc.

要使用“ Flash Fill”功能,请首先在第1行中键入列标题。对于我们的示例,“ Employee ID”将在单元格B1中,“ First Name”将在单元格C1中,等等。

For each column, select your header row. Start with B1 (the “Employee ID” header in this example) and then, in the “Data Tools” section of the “Data” tab, click the “Flash Fill” button.

对于每一列,选择标题行。 以B1(在此示例中为“ Employee ID”标题)开头,然后在“数据”选项卡的“数据工具”部分中,单击“ Flash Fill”按钮。

sqlserver中将多列_如何在Excel中将一个长列变成多个列

Repeat the action for each of your header cells (C1, D1, etc) to automatically fill the new columns with the matching data.

对每个标题单元格(C1,D1等)重复该操作,以自动用匹配的数据填充新列。

If the data is formatted correctly in your original column, Excel will automatically separate the content using the original header cell (A1) as its guide. If you receive an error, type the following value in the sequence in the cell below your header cell, then click the “Flash Fill” button again.

如果原始列中的数据格式正确,则Excel将使用原始标题单元格(A1)作为指南自动分离内容。 如果收到错误,请在标题单元格下面的单元格中按顺序键入以下值,然后再次单击“ Flash Fill”按钮。

In our example, that would be the first data example in cell B2 (“101”) after the header cell in B1 (“Employee ID”).

在我们的示例中,这将是B1中标头单元格(“员工ID”)之后单元格B2(“ 1​​01”)中的第一个数据示例。

sqlserver中将多列_如何在Excel中将一个长列变成多个列

Each new column will fill with the data from the original column, using the initial first or second rows as the guide to choose the correct data.

每个新列将使用原始第一行或第二行作为选择正确数据的指南来填充原始列中的数据。

sqlserver中将多列_如何在Excel中将一个长列变成多个列

In the example above, the long column (column A) has been separated into six new columns (B to G).

在上面的示例中,长列(A列)已分为六个新列(B至G)。

Because the layout of rows 1 to 12 is the same, the “Flash Fill” feature is able to copy and separate the data, using the header row and first bit of data.

由于行1至12的布局相同,因此“闪存填充”功能可以使用标题行和数据的第一位来复制和分离数据。

翻译自: https://www.howtogeek.com/450927/how-to-make-one-long-column-into-multiple-columns-in-excel/

sqlserver中将多列