Bỏ qua nội dung chính

Làm thế nào để sắp xếp dữ liệu chữ và số trong Excel?

Nếu bạn có danh sách dữ liệu được trộn lẫn với cả số và chuỗi văn bản, khi bạn sắp xếp dữ liệu cột này bình thường trong Excel, tất cả các số thuần túy được sắp xếp ở trên cùng và chuỗi văn bản hỗn hợp ở dưới cùng. Tuy nhiên, kết quả cần thiết của bạn như ảnh chụp màn hình cuối cùng được hiển thị. Bài viết này sẽ cung cấp một phương pháp hữu ích mà bạn có thể sử dụng để sắp xếp dữ liệu chữ và số trong Excel để bạn có thể đạt được kết quả như mong muốn.

Sắp xếp dữ liệu chữ và số với cột trợ giúp công thức

Dữ liệu gốc   Thông thường sắp xếp kết quả   kết quả sắp xếp mong muốn của bạn
doc sắp xếp chữ và số 1 2 doc sắp xếp chữ và số 2 2 doc sắp xếp chữ và số 3

mũi tên màu xanh bong bóng bên phải Sắp xếp dữ liệu chữ và số với cột trợ giúp công thức

Trong Excel, bạn có thể tạo cột trợ giúp công thức, sau đó sắp xếp dữ liệu theo cột mới này, vui lòng thực hiện theo các bước sau:

1. Nhập công thức này = TEXT (A2, "###") vào một ô trống bên cạnh dữ liệu của bạn, chẳng hạn như B2, ​​hãy xem ảnh chụp màn hình:

doc sắp xếp chữ và số 4

2. Sau đó, kéo chốt điền xuống các ô mà bạn muốn áp dụng công thức này, xem ảnh chụp màn hình:

doc sắp xếp chữ và số 5

3. Và sau đó sắp xếp dữ liệu theo cột mới này, chọn cột trợ giúp bạn đã tạo, sau đó nhấp vào Ngày > Sắp xếpvà trong hộp nhắc hiện ra, hãy chọn Mở rộng sự lựa chọn, xem ảnh chụp màn hình:

doc sắp xếp chữ và số 6 2 doc sắp xếp chữ và số 7

4. và bấm Sắp xếp để mở Sắp xếp hộp thoại, dưới Cột phần, chọn Cột người trợ giúp tên mà bạn muốn sắp xếp và sử dụng Các giá trị Dưới Sắp xếp và sau đó chọn thứ tự sắp xếp như bạn muốn, xem ảnh chụp màn hình:

doc sắp xếp chữ và số 8

5. Và sau đó nhấp vào OK, trong hộp thoại Cảnh báo Sắp xếp hiện ra, vui lòng chọn Sắp xếp số và số được lưu trữ dưới dạng văn bản riêng biệt, xem ảnh chụp màn hình:

doc sắp xếp chữ và số 9

6. Sau đó nhấn vào OK , bạn có thể thấy, dữ liệu đã được sắp xếp theo nhu cầu của bạn.

doc sắp xếp chữ và số 10

7. Cuối cùng, bạn có thể xóa nội dung của cột trợ giúp khi cần.

Công cụ năng suất văn phòng tốt nhất

🤖 Trợ lý AI của Kutools: Cách mạng hóa việc phân tích dữ liệu dựa trên: Thực thi thông minh   |  Tạo mã  |  Tạo công thức tùy chỉnh  |  Phân tích dữ liệu và tạo biểu đồ  |  Gọi các hàm Kutools...
Các tính năng phổ biến: Tìm, đánh dấu hoặc xác định các bản sao   |  Xóa hàng trống   |  Kết hợp các cột hoặc ô mà không làm mất dữ liệu   |   Vòng không có công thức hữu ích. Cảm ơn !
Siêu tra cứu: Nhiều tiêu chí VLookup    VLookup Nhiều Giá Trị  |   VLookup trên nhiều trang tính   |   Tra cứu mờ ....
Danh sách thả xuống nâng cao: Tạo nhanh danh sách thả xuống   |  Danh sách thả xuống phụ thuộc   |  Danh sách thả xuống nhiều lựa chọn ....
Trình quản lý cột: Thêm một số cột cụ thể  |  Di chuyển cột  |  Chuyển đổi trạng thái hiển thị của các cột ẩn  |  So sánh dãy và cột hữu ích. Cảm ơn !
Các tính năng nổi bật: Tiêu điểm lưới   |  Chế độ xem thiết kế   |   Thanh công thức lớn    Trình quản lý sổ làm việc & trang tính   |  Thư viện tài nguyên (Văn bản tự động)   |  Bảng chọn ngày   |  Kết hợp các bảng tính   |  Mã hóa/Giải mã ô    Gửi email theo danh sách   |  Siêu lọc   |   Bộ lọc đặc biệt (lọc in đậm/nghiêng/gạch ngang...) ...
15 bộ công cụ hàng đầu12 bản văn CÔNG CỤ (thêm văn bản, Xóa ký tự,...)   |   50 + Biểu đồ Các loại (Biểu đồ Gantt,...)   |   40+ Thực tế Công thức (Tính tuổi dựa trên ngày sinh,...)   |   19 chèn CÔNG CỤ (Chèn mã QR, Chèn ảnh từ đường dẫn,...)   |   12 Chuyển đổi CÔNG CỤ (Số thành từ, Chuyển đổi tiền tệ,...)   |   7 Hợp nhất & Tách CÔNG CỤ (Các hàng kết hợp nâng cao, Chia ô,...)   |   ... và nhiều hơn nữa

Nâng cao kỹ năng Excel của bạn với Kutools for Excel và trải nghiệm hiệu quả hơn bao giờ hết. Kutools for Excel cung cấp hơn 300 tính năng nâng cao để tăng năng suất và tiết kiệm thời gian.  Bấm vào đây để có được tính năng bạn cần nhất...

Mô tả


Tab Office mang lại giao diện Tab cho Office và giúp công việc của bạn trở nên dễ dàng hơn nhiều

  • Cho phép chỉnh sửa và đọc theo thẻ trong Word, Excel, PowerPoint, Publisher, Access, Visio và Project.
  • Mở và tạo nhiều tài liệu trong các tab mới của cùng một cửa sổ, thay vì trong các cửa sổ mới.
  • Tăng 50% năng suất của bạn và giảm hàng trăm cú nhấp chuột cho bạn mỗi ngày!
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.
This comment was minimized by the moderator on the site
I am running in the same problem. I have 1200 part numbers that I need to sort the way it's shown above but excel will put V15 after V1 if V14 is absent. I need V14 to appear after V9 or V8, where ever the part number ends.
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? 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
When I do this, the column sorts by individual character and I don't get the right order. For instance, if I have the following data: A1: 1 A2: 2 A3: 1a1 A4: 12 A5: 1a2 I want them to be sorted like this: A1: 1 A2: 1a1 A3: 1a2 A4: 2 A5: 12 Just sorting the column normally I end up with this: A1: 1 A2: 2 A3: 12 A4: 1a1 A5: 1a2 Where the numbers are sorted correctly and then the alphanumeric values are sorted correctly, but the two are not sorted together. When I use the method in the article, I end up with this: A1: 1 A2: 12 A3: 1a1 A4: 1a2 A5: 2 Where the numeric and alphanumeric data are sorted together but incorrectly (12 should come after 2). Why is this happening?
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations