跳到主要内容

如何在Excel中对字母数字数据进行排序?

作者:晓阳 最后修改时间:2020-11-26

如果您有一个混合了数字和文本字符串的数据列表,则在Excel中通常对该列数据进行排序时,所有纯数字都在顶部排序,混合文本字符串在底部排序。 但是,您需要的结果类似于显示的最后一个屏幕截图。 本文将提供一种有用的方法,可用于在Excel中对字母数字数据进行排序,以便获得所需的结果。

使用公式助手列对字母数字数据进行排序

原始数据   通常排序结果   您想要的排序结果
doc字母数字1 2 doc字母数字2 2 doc字母数字3

箭头蓝色右气泡 使用公式助手列对字母数字数据进行排序

在Excel中,您可以创建一个公式帮助器列,然后按此新列对数据进行排序,请执行以下步骤:

1。 输入此公式 = TEXT(A2,“ ###”) 例如,将数据放入B2之外的空白单元格中,请参见屏幕截图:

doc字母数字4

2。 然后将填充手柄向下拖动到要应用此公式的单元格,请参见屏幕截图:

doc字母数字5

3。 然后按此新列对数据进行排序,选择您创建的帮助器列,然后单击 时间 > 排序,然后在弹出的提示框中选择 扩大选择,请参见屏幕截图:

doc字母数字6 2 doc字母数字7

4。 并点击 排序 按钮打开 排序 对话框下 部分中,选择 助手专栏 您要排序的名称,并使用 价值观排序 部分,然后根据需要选择排序顺序,请参见屏幕截图:

doc字母数字8

5。 然后点击 OK,在弹出的“排序警告”对话框中,请选择 分别对数字和存储为文本的数字进行排序,请参见屏幕截图:

doc字母数字9

6. 然后点击 OK 按钮,您会看到,数据已经按照您的需要进行了排序。

doc字母数字10

7。 最后,您可以根据需要删除帮助器列的内容。

最佳办公生产力工具

🤖 Kutools 人工智能助手:基于以下内容彻底改变数据分析: 智能执行   |  生成代码  |  创建自定义公式  |  分析数据并生成图表  |  调用 Kutools 函数...
热门特色: 查找、突出显示或识别重复项   |  删除空白行   |  合并列或单元格而不丢失数据   |   不使用公式进行四舍五入 ...
超级查询: 多条件VLookup    多值VLookup  |   跨多个工作表的 VLookup   |   模糊查询 ....
高级下拉列表: 快速创建下拉列表   |  依赖下拉列表   |  多选下拉列表 ....
列管理器: 添加特定数量的列  |  移动列  |  切换隐藏列的可见性状态  |  比较范围和列 ...
特色功能: 网格焦点   |  设计图   |   大方程式酒吧    工作簿和工作表管理器   |  资源库 (自动文本)   |  日期选择器   |  合并工作表   |  加密/解密单元格    按列表发送电子邮件   |  超级筛选   |   特殊过滤器 (过滤粗体/斜体/删除线...)...
前 15 个工具集12 文本 工具 (添加文本, 删除字符,...)   |   50+ 图表 类型 (甘特图,...)   |   40+ 实用 公式 (根据生日计算年龄,...)   |   19 插入 工具 (插入二维码, 从路径插入图片,...)   |   12 转化 工具 (小写金额转大写, 货币兑换,...)   |   7 合并与拆分 工具 (高级组合行, 分裂细胞,...)   |   ... 和更多

使用 Kutools for Excel 增强您的 Excel 技能,体验前所未有的效率。 Kutools for Excel 提供了 300 多种高级功能来提高生产力并节省时间。  单击此处获取您最需要的功能...

描述


Office Tab 为 Office 带来选项卡式界面,让您的工作更加轻松

  • 在Word,Excel,PowerPoint中启用选项卡式编辑和阅读,发布者,Access,Visio和Project。
  • 在同一窗口的新选项卡中而不是在新窗口中打开并创建多个文档。
  • 每天将您的工作效率提高50%,并减少数百次鼠标单击!
Comments (10)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
The stock symbol for TrueCar Inc is "TRUE". When I sort the column containing the stock symbols, TRUE falls out of place at the end of the list. The cell is formatted as text. I am assuming that it is because "TRUE" has special meaning in Excel. Right now I am removing the "E", sorting the column so the row falls in the right place and then adding the E after the sort. Any ideas on a better approach?  
This comment was minimized by the moderator on the site
Hi, I have a similar sorting requirement, but with a unique problem ....
I have a range of Stock data which I need to sort in Category order.
The Range includes prices and one column has formulas.
The Category numbers range from 1 1a 1b etc to 32e.
I have continuously tried using a helper column with the formula =TEXT(K3,"###") - with K3 being the first Row in the Category column.
I select the helper column (N) and click Data - Sort - Expand the selection, but get no further as the "expansion" always selects from Row 40 - even if I select just a few rows in the helper column.
Why is this, and how can I sort my data correctly ?
Looking forward to a solution ....
Thanks.
Patrick.
This comment was minimized by the moderator on the site
Thanks for the tip on using a "helper column", but here's my question:

Is there a way to get the "related " columns to "tag along" with the sort precipitated by the helper column?

For example, column A contains a mixed-string product code that I can now sort into sequence using the "helper column" technique but, attached to that same product code are product descriptions, dimensions and other characteristics (some of which are also mixed-string in nature) in several other columns, and I need those to follow the "helper column" sort.

Any suggestions?

Much appreciated!

Lorne
This comment was minimized by the moderator on the site
I only see 1 method. Top of the article mentions that we will see 2 methods.
This comment was minimized by the moderator on the site
Hello, val,
Thank you for your comment, it is my mistake, I have deleted the second method from this article, and now, I have updated the article.

Thank you once more!
This comment was minimized by the moderator on the site
Trying to sort Alphanumeric with text. It is a fairly large list but below is an example. I can't strip the off the letter in a different column and sort by that because I have matching numbers that should come before them. I also can't really add a column to sort by and then hide that column - or delete it because I am constantly sorting the data. Any ideas? Will there be some formula? My current list: ---- What I want it to look like: 1 ---- 1 2 ---- 2 3 ---- 3 4 ---- 4 A1 ---- A1 A10 ---- A2 A100 ---- A3 A2 ---- A4 A20 ---- A5 A200 ---- A6 A3 ---- A7 A4 ---- A8 A5 ---- A9 A6 ---- A10 A60 ---- A20 A7 ---- A60 A8 ---- A100 A9 ---- A200
This comment was minimized by the moderator on the site
The easiest way I can think is to split the column into the Alpha part ("A") and the numeric part ("1") and then sort first by alpha then by numeric.
Your original 1,2,3,4 would need to stay in the alpha column to sort properly .

N.B. this might be a bit more difficult to achieve when the alpha part (the "A") is not a consistent length in your data. But definitely still possible.
There are no comments posted here yet
Load More
Leave your comments
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations