Excel’s Text to Columns feature splits text in a cell into multiple columns. This simple task can save a user the heartache of manually separating the text in a cell into several columns.

Excel的“文本到列”功能可将单元格中的文本拆分为多列。 这个简单的任务可以节省用户手动将单元格中的文本分成几列的麻烦。

We’ll start with a simple example of splitting two samples of data into separate columns. Then, we’ll explore two other uses for this feature that most Excel users are not aware of.

我们将从一个简单的示例开始,该示例将两个数据样本拆分为单独的列。 然后,我们将探索该功能的其他两种用法,大多数Excel用户都不知道。

文本到带有分隔文本的列 (Text to Columns with Delimited Text)

For the first example, we will use Text to Columns with delimited data. This is the more common scenario for splitting text, so we will start with this.

对于第一个示例,我们将使用带有定界数据的“文本到列”。 这是分割文本的较常见方案,因此我们将从此开始。

In the sample data below we have a list of names in a column. We would like to separate the first and last name into different columns.

在下面的示例数据中,我们在列中列出了名称。 我们想将名字和姓氏分成不同的列。

In this example, we would like the first name to remain in column A for the last name to move to column B. We already have some information in column B (the Department). So we need to insert a column first and give it a header.

在此示例中,我们希望名字保留在A列中,而姓氏移到B列。我们在B列(部门)中已经有了一些信息。 因此,我们需要先插入一列并为其提供标题。

Next, select the range of cells containing the names and then click Data > Text to Columns

接下来,选择包含名称的单元格范围,然后单击“数据”>“文本到列”

This opens a wizard in which you’ll perform three steps. Step one is to specify how the content is separated. Delimited means the different pieces of text you want to pull apart are separated by a special character such as space, comma, or slash. That’s the one we’re going to choose here. (We’ll talk about the fixed width option in the next section.)

这将打开一个向导,您将在其中执行三个步骤。 第一步是指定如何分隔内容。 分隔表示要分开的不同文本用特殊字符分隔,例如空格,逗号或斜杠。 那就是我们要在这里选择的那个。 (我们将在下一节中讨论“固定宽度”选项。)

In the second step, specify the delimiter character. In our simple example data, the first and last names are delimited by a space. So, we’re going to remove the check from the “Tab” and add a check to the “Space” option.

在第二步中,指定分隔符。 在我们的简单示例数据中,名字和姓氏由空格分隔。 因此,我们要从“制表符”中删除支票,并在“空格”选项中添加支票。

In the final step, we can format the content. For our example, we do not need to apply any formatting, but you could do things like specify whether the data is in the text or date format, and even set it up so that one format converts to another during the process.

在最后一步,我们可以格式化内容。 对于我们的示例,我们不需要应用任何格式,但是您可以执行诸如指定数据是文本格式还是日期格式的操作,甚至可以设置数据以便在处理过程中将一种格式转换为另一种格式。

We will also leave the destination as $A$2 so that it splits the name from its current position, and moves the last name into column B.

我们还将目的地保留为$ A $ 2,以便它将名称从当前位置拆分出来,并将姓氏移动到B列中。

When we click “Finish” on the wizard, Excel separates the first and last names and we now have our new, fully populated Column B.

当我们在向导上单击“完成”时,Excel会将名字和姓氏分开,现在我们有了新的,完全填充的列B。

文本到具有固定宽度文本的列 (Text to Columns with Fixed Width Text)

In this example, we will split text that has a fixed width. In the data below, we have an invoice code that always begins with two letters followed by a variable number of numeric digits. The two-letter code represents the client and the numeric value after it represents the invoice number. We want to separate the first two characters of the invoice code from the numbers that succeed it and deposit those values into the Client and Invoice No columns we’ve set up (columns B and C). We also want to keep the full invoice code intact in Column A.

在此示例中,我们将拆分宽度固定的文本。 在下面的数据中,我们有一个发票代码,该代码始终以两个字母开头,后跟可变数量的数字。 两个字母的代码表示客户,后面的数字表示发票编号。 我们希望将发票代码的前两个字符与其后的数字分开,并将这些值存入我们已设置的“客户”和“发票编号”列(B和C列)。 我们还希望在A列中保留完整的发票代码。

Because the invoice code is always two characters, it has a fixed width.

因为发票代码始终是两个字符,所以它具有固定的宽度。

Start by selecting the range of cells containing the text you want to split and then clicking Data > Text to Columns.

首先选择包含要拆分的文本的单元格范围,然后单击“数据”>“文本到列”。

On the first page of the wizard, select the “Fixed Width” option and then click “Next.”

在向导的第一页上,选择“固定宽度”选项,然后单击“下一步”。

On the next page, we need to specify the position(s) in the column to split the content. We can do this by clicking in the preview area provided.

在下一页上,我们需要在列中指定位置以拆分内容。 我们可以通过单击提供的预览区域来做到这一点。

Note: Text to Columns sometimes provides a suggested break(s). This can save you some time, but keep an eye on it. The suggestions are not always correct.

注意:“文本到列”有时会建议一个中断。 这样可以节省您一些时间,但请注意一下。 这些建议并不总是正确的。

In the “Data Preview” area, click where you want to insert the break and then click “Next.”

在“数据预览”区域中,单击要插入中断的位置,然后单击“下一步”。

In the final step, type cell B2 (=$B$2) in the Destination box and then click “Finish.”

在最后一步中,在“目标”框中键入单元格B2(= $ B $ 2),然后单击“完成”。

The invoice numbers are successfully separated into columns B and C. The original data remains in column A.

发票编号已成功分为B列和C列。原始数据保留在A列中。

So, we’ve now looked at splitting content using delimiters and fixed widths. We’ve also looked at splitting text in place and splitting it to different places on a worksheet. Now let’s look at two extra special uses of Text to Columns.

因此,我们现在研究了使用定界符和固定宽度分割内容。 我们还研究了将文本拆分到适当位置并将其拆分到工作表上的不同位置的情况。 现在,让我们看一下“文本到列”的两个特殊用途。

将美国日期转换为欧洲格式 (Converting US Dates to European Format)

One fantastic use of Text to Columns is to convert date formats. For example, converting a US date format to European or vice versa.

文本到列的一种奇妙用法是转换日期格式。 例如,将美国日期格式转换为欧洲日期,反之亦然。

I live in the UK so when I import data into an Excel spreadsheet, sometimes they are stored as text. This is because the source data is from the US and the date formats do not match the regional settings configured in my installation of Excel.

我住在英国,因此当我将数据导入Excel电子表格时,有时它们会以文本形式存储。 这是因为源数据来自美国,并且日期格式与在我的Excel安装中配置的区域设置不匹配。

So, its Text to Columns to the rescue to get these converted. Below are some dates in US format that my copy of Excel has not understood.

因此,将其“文本转换为列”进行救援以获取这些转换。 以下是我的Excel副本无法理解的美国日期格式。

First, we’re going to select the range of cells containing the dates to convert and then click Data > Text to Columns.

首先,我们将选择包含要转换日期的单元格范围,然后单击“数据”>“文本到列”。

On the first page of the wizard, we’ll leave it as delimited and on the second step, we’ll remove all the delimiter options because we don’t actually want split any content.

在向导的第一页上,将其定界,而在第二步上,我们将删除所有定界符选项,因为我们实际上并不希望分割任何内容。

On the final page, select the Date option and use the list to specify the date format of the data you have received. In this example, I will select MDY—the format typically used in the US.

在最后一页上,选择“日期”选项,然后使用列表指定所接收数据的日期格式。 在此示例中,我将选择MDY(美国通常使用的格式)。

After clicking “Finish,” the dates are successfully converted and are ready for further analysis.

单击“完成”后,日期将成功转换,并准备进行进一步分析。

转换国际数字格式 (Converting International Number Formats)

In addition to being a tool for converting different date formats, Text to Columns can also convert international number formats.

除了作为转换不同日期格式的工具外,“文本到列”还可以转换国际数字格式。

Here in the UK, a decimal point is used in number formats. So for example, the number 1,064.34 is a little more than one thousand.

在英国,数字格式使用小数点。 例如,数字1,064.34略大于一千。

But in many countries, a decimal comma is used instead. So that number would be misinterpreted by Excel and stored as text. They would present the number as 1.064,34.

但是在许多国家/地区,使用小数逗号代替。 因此,该数字将被Excel误解并存储为文本。 他们将显示数字为1.064,34。

Thankfully when working with international number formats in Excel, our good friend Text to Columns can assist us with converting these values.

值得庆幸的是,在Excel中使用国际数字格式时,我们的好朋友“文本到列”可以帮助我们转换这些值。

In the example below, I have a list of numbers formatted with a decimal comma. So my regional settings in Excel have not recognized them.

在下面的示例中,我有一个用十进制逗号格式化的数字列表。 因此,我在Excel中的区域设置无法识别它们。

This process is almost identical to the one we used for converting dates. Select the range of values, head to Data > Text to Columns, select the delimited option, and remove all the delimiter characters. On the final step of the wizard, this time we’re going to choose the “General” option and then click the “Advanced” button.

此过程几乎与我们用于转换日期的过程相同。 选择值的范围,转到“数据”>“文本到列”,选择定界选项,然后删除所有定界符。 在向导的最后一步,这次我们将选择“常规”选项,然后单击“高级”按钮。

In the settings window that opens, enter the character you want to use in the Thousand separator and Decimal separator boxes provided. Click “OK” and then click “Finish” when you get back to the wizard.

在打开的设置窗口中,在提供的千位分隔符和十进制分隔符框中输入要使用的字符。 单击“确定”,然后在返回向导时单击“完成”。

The values are converted and now recognized as numbers for further calculation and analysis.

这些值已转换,现在可以识别为数字,以供进一步计算和分析。



Text to Columns is more powerful than people realize. Its classic use to separate content into different columns is incredibly useful. Especially when working with data we receive from others. The lesser-known abilities to convert date and international number formats are magic.

文字到列的功能比人们想象的要强大。 它的经典用法是将内容分为不同的列,这非常有用。 特别是在处理数据时,我们会从其他人那里收到。 鲜为人知的转换日期和国际数字格式的能力是神奇的。

翻译自: https://www.howtogeek.com/407217/how-to-use-text-to-columns-like-an-excel-pro/

如何像Excel Pro一样使用文本到列相关推荐

  1. 计算机excel教程文字版,Excel函数教程:文本函数

    Excel函数教程:文本函数 所谓文本函数,就是可以在公式中处理文字串的函数.例如,可以改变大小写或确定文字串的长度:可以替换某些字符或者去除某些字符等.而日期和时间函数则可以在公式中分析和处理日期值 ...

  2. 前端利用JS导出数据到Excel表 数字是文本类型 无法计算

    问题描述:前端利用JS导出数据到Excel表 数字是文本类型 无法进行公式计算:前端利用JS导出数据到Excel表 数字是文本类型 无法计算 解决办法:参考https://bbs.csdn.net/t ...

  3. 学习excel的使用技巧复制一列文本成新列去重

    学习excel的使用技巧复制一列文本成新列去重 学习excel的使用技巧复制一列文本成新列去重 其实比较简单的技巧  知道了就会  不知道就比较麻烦 1 直接复制到一列 2 找到 数据选项 3 删除重 ...

  4. html 链接excel,如何把excel表格中的文本链接变成可点击打开的网址链接(超链接)?...

    如何将excel表格中的网址全部设置成超链接?我们从网上下载的excel表格中会有一些网址链接,但这样的网址链接是一个文本的格式,我们是无法点击跳转到网页的.下面小编就给大家介绍如何把表格中的文本格式 ...

  5. 使用计算机制作数字文本格式,电脑excel表格如何将文本格式变成数字格式

    电脑excel表格如何将文本格式变成数字格式 文本格式和数字格式的单元格显示是有部分不一样的,今天小编就告诉大家电脑excel表格如何将文本格式变成数字格式. 具体如下: 1.首先我们打开电脑中的Ex ...

  6. 【使用指南】Excel筛选包含指定文本所在的整行

    使用Excel筛选包含指定文本所在的整行 最近遇到了需要收集到的信息进行筛选的问题,但苦于对excel一窍不通,赶紧学习一波. 现在记录与分享一个excel的小技巧,利用excel对信息进行筛选.小明 ...

  7. WPS Excel表格日期转文本 为数字问题

    WPS Excel表格日期转文本 为数字问题 有时候我们需要Excel表格里的日期为文本格式,但是当我们转为文本格式的时候,日期变为一串数字啦.找了很多方法,比如使用TEXT()函数等,但感觉不是很适 ...

  8. Excel从txt导入文本并将空行删除

    Excel从txt导入文本并将空行删除 前言 一.从txt文件导入文本内容 方法: 例子: 二.把导入的文本内容中的空行删除 方法: 例子: 总结 前言 经常会有数据保存成文本格式,但在数据处理的时候 ...

  9. 怎么在Excel中查找指定文本并标记颜色

    今天跟大家分享一下怎么在Excel中查找指定文本并标记颜色 1.如下图,我们想要在表格中快速查找标记"李虹霖" 2.首选我们全选表格区域 3.然后点击下图选项(Excel工具箱,百 ...

最新文章

  1. esxi4.1使用IDE格式磁盘
  2. Eclipse导入项目: No projects are found to import
  3. html网站开发与php网站开发_海南网站开发,网站建设,商城网站,功能性网站开发...
  4. 数据可视化模板_10分钟,做一份数据可视化分析报表
  5. boost::bad_function_call用法的测试程序
  6. python重定向cookie_模拟登陆中 302 重定向和 cookies 的一些困惑
  7. linux下提示libpng12-0缺失
  8. 输液药房管理行业调研报告 - 市场现状分析与发展前景预测
  9. linux卸载wine qq,ubuntu安装wineQQ
  10. uniapp发布苹果IOS测试版 下载无法安装
  11. 精益生产——5S管理
  12. 详解4种类型的爬虫技术
  13. 怎样提升小程序UV访客,快速开通流量主!
  14. 单片机p1口亮灯实验c语言代码,手把手教你单片机流水灯实验(详解)
  15. Java容器(List、Set、Map)知识点快速复习手册
  16. Java入门(四)JAVA SE 02
  17. RTX 3060Ti和rtx2080Super的区别
  18. 4.16周赛---玩游戏
  19. 章鱼网络 Community Call #4|推进章鱼社区治理
  20. [Vue warn]: Invalid VNode type: undefined

热门文章

  1. matlab 实现分层聚类算法,[转载]MATLAB层次聚类分析法(转)
  2. 通过CSS样式修改超链接颜色下划线
  3. 龙芯1B:pwm的使用例程
  4. 第一章 QEMU虚拟机与ARM64平台搭建
  5. [个人笔记]计算机网络
  6. Spring安装和使用(Eclipse环境)
  7. zRAM内存压缩技术分析及优化方向
  8. 增值税专用发票与增值税普通发票的区别?
  9. 深度解析自媒体淘客如何做到月入3万
  10. 米国什么时候会毁灭世界?