跳到主要內容

如何在Excel中按字符長度對列列表進行排序?

假設您有一個包含不同字符的字符串列表,並且需要按照字符長度對列中的數據進行排序,如下面的屏幕截圖所示。 您是否有一些簡單的方法來完成它?

doc-按長度排序 -2 doc-按長度排序

使用助手列按字符長度對列列表進行排序

使用Kutools for Excel按字符長度對列列表進行排序


箭頭藍色右氣泡使用助手列按字符長度對列列表進行排序

沒有直接功能按字符長度對列列表進行排序,因此您需要使用幫助列來首先計算字符串的數量,然後對它們進行排序。

1. 在值列旁邊,輸入 = LEN(A1) 空白單元格B1中的公式,請參見屏幕截圖:

doc-按長度排序

2。 然後按 Enter 鍵,您將獲得文本字符串的編號,然後選擇單元格B1並將填充手柄拖動到要包含此公式的範圍。

doc-按長度排序

3。 A列中的所有字符串數已在B列中提取,然後您可以通過單擊 數據 > 分類,請參見屏幕截圖:

doc-按長度排序

4.排序警告 提示框,選中 擴大選擇 選項,然後單擊 分類 按鈕。

doc-按長度排序

5。 然後在 分類 對話框中選擇 B欄 您要作為排序依據的類型,然後選擇需要進行排序的類型,最後選擇排序順序,在這裡我們選擇 價值觀 ,在 排序 下拉列表和 最小到最大 in 過往訂單 下拉列表。 看截圖:

doc-按長度排序

6。 然後點擊 OK,並且字符串已按字符長度排序。 您可以根據需要刪除列B。 看截圖:

doc-按長度排序


箭頭藍色右氣泡使用Kutools for Excel按字符長度對列列表進行排序

使用上述方法,您需要創建一個幫助列拳頭,這對您來說有點麻煩。 但是使用 高級排序 功能 Excel的Kutools 您可以一次按字符長度對列表進行排序。

Excel的Kutools 包括300多個便捷的Excel工具。 30天免費試用,不受限制。 立即獲取

步驟1.選擇要按字符長度排序的列表,然後單擊 企業 > 高級排序。 看截圖:


步驟2.然後 高級排序 對話框顯示在屏幕上,選擇列表中的列,然後選擇 文字長度 來自 排序 下拉列表,然後指定 過往訂單 你需要。 (如果您選擇的列表具有標題,請選中 我的數據有標題 框。)請參見屏幕截圖:


步驟3。 點擊 Ok,您可以看到列表按字符長度排序如下:

如果您選擇 Z到A ,在 過往訂單 在第2步中,結果如下所示:


有關Kutools for Excel的高級排序的更多信息。


相關文章:

如何在Excel中按絕對值對單元格進行排序?

最佳辦公生產力工具

🤖 Kutools 人工智慧助手:基於以下內容徹底改變數據分析: 智慧執行   |  生成代碼  |  建立自訂公式  |  分析數據並產生圖表  |  呼叫 Kutools 函數...
熱門特色: 尋找、突出顯示或識別重複項   |  刪除空白行   |  合併列或儲存格而不遺失數據   |   沒有公式的回合 ...
超級查詢: 多條件VLookup    多值VLookup  |   跨多個工作表的 VLookup   |   模糊查詢 ....
高級下拉列表: 快速建立下拉列表   |  依賴下拉列表   |  多選下拉列表 ....
欄目經理: 新增特定數量的列  |  移動列  |  切換隱藏列的可見性狀態  |  比較範圍和列 ...
特色功能: 網格焦點   |  設計圖   |   大方程式酒吧    工作簿和工作表管理器   |  資源庫 (自動文字)   |  日期選擇器   |  合併工作表   |  加密/解密單元格    按清單發送電子郵件   |  超級濾鏡   |   特殊過濾器 (過濾粗體/斜體/刪除線...)...
前 15 個工具集12 文本 工具 (添加文本, 刪除字符,...)   |   50+ 圖表 類型 (甘特圖,...)   |   40+ 實用 公式 (根據生日計算年齡,...)   |   19 插入 工具 (插入二維碼, 從路徑插入圖片,...)   |   12 轉化 工具 (數字到單詞, 貨幣兌換,...)   |   7 合併與拆分 工具 (高級合併行, 分裂細胞,...)   |   ... 和更多

使用 Kutools for Excel 增強您的 Excel 技能,體驗前所未有的效率。 Kutools for Excel 提供了 300 多種進階功能來提高生產力並節省時間。  點擊此處獲取您最需要的功能...

產品描述


Office選項卡為Office帶來了選項卡式界面,使您的工作更加輕鬆

  • 在Word,Excel,PowerPoint中啟用選項卡式編輯和閱讀,發布者,Access,Visio和Project。
  • 在同一窗口的新選項卡中而不是在新窗口中打開並創建多個文檔。
  • 將您的工作效率提高 50%,每天為您減少數百次鼠標點擊!

 

Comments (12)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
hi,

The sort does not seem to works.
It just sort like the LEN function.
could you please help?
This comment was minimized by the moderator on the site
Hello friend,

Sorry to hear that. The LEN function should work on your computer. One possible reason why the LEN function doesn't work is that the Show Formulas function under the Formulas tab is turned on. Please see the screenshot. Please turn off the Show Formulas function. If the problem still exists, please provide us with more details. Looking forward to your reply.

Sincerely,
Mandy
This comment was minimized by the moderator on the site
Thank you, great info!
This comment was minimized by the moderator on the site
a big thank you!
This comment was minimized by the moderator on the site
Thank you very much,, it is very useful, keep going.
This comment was minimized by the moderator on the site
Kind of pointless, expected more, but I will take.
This comment was minimized by the moderator on the site
Thanks for the help! Brilliant!
This comment was minimized by the moderator on the site
Thank you exactly what I was looking for too. Worked perfectly to sort email subject lines by length. Was experiencing an error during export and figured out it was due to length of filenames created from the subject line by the export process. This helper column formula allowed me to isolate which emails would cause the error, and proved my theory. Saved me hours sifting through literally thousands of emails. Many thanks.
This comment was minimized by the moderator on the site
Thank you! it worked for me, though I had to use LENB function, LEN didn't work.
This comment was minimized by the moderator on the site
there is no lenb function
This comment was minimized by the moderator on the site
This is what i was just looking for and nothing better than interactive snap-shots. i just looked here and tried in excel....and worked ! Thank you so much.
This comment was minimized by the moderator on the site
I love it! Just what I was looking for. I love KuTools & Enterprise, use them every single day in Excel. Thank you!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations