跳到主要內容

如何從Excel中的列表中查找最常見的值(數字或文本字符串)?

假設您有一個包含一些重複項的名稱列表,現在,您要提取出現頻率最高的值。 直接的方法是從列表中逐一計算數據以獲得結果,但是如果列中有成千上萬個名稱,這種方法將很麻煩且耗時。 以下教程將向您介紹一些技巧,可以快速方便地解決此任務。

使用數組公式從列表中查找最常用的值(數字或文本字符串)

通常,我們可以應用 MODE 功能(=模式(A1:A16))以查找範圍內最常見的數字。 但是此MODE功能不適用於文本字符串。 要提取最常出現的值,可以應用以下數組公式。 請這樣做:

在數據旁邊的空白單元格中,輸入以下公式,然後按 Shift + Ctrl + 輸入 鑰匙在一起。

=INDEX($A$1:$A$16,MODE(MATCH($A$1:$A$16,$A$1:$A$16,0)))

筆記:
1. A1:A16 是您想要獲得最頻繁值的數據范圍。 您可以根據需要進行更改。
2.當列表中有空白單元格時,此數組公式將不起作用。

注意絲帶 公式太難記了嗎? 將公式另存為“自動文本”條目,以供日後再次使用!
閱讀全文...     免費試用

在Excel中輕鬆按出現頻率排序

Kutools for Excel的 高級排序 該實用程序支持在Excel中按文本長度,姓氏,絕對值,頻率等對數據進行快速排序。


廣告按頻率2排序

Excel的Kutools - 使用 300 多種基本工具增強 Excel 功能。 享受全功能 30 天免費試用,無需信用卡! 立即行動吧!

尋找最普遍的價值 (數字或文本字符串) 從帶有VBA代碼的列表中

使用以下VBA代碼,您不僅可以找到出現次數最多的值,還可以計算出最常見單詞的次數。

1。 按住 ALT + F11 鍵,然後打開 Microsoft Visual Basic for Applications窗口.

2。 點擊 插入 > 模塊,然後將以下代碼粘貼到 模塊窗口.

VBA代碼:從列表中找到最常見的值

Sub FindFrequency()
'Update 20140326
Dim Rng As Range
Dim WorkRng As Range
Set dic = CreateObject("scripting.dictionary")
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
xMax = 0
xOutValue = ""
For Each Rng In WorkRng
    xValue = Rng.Value
    If xValue <> "" Then
        dic(xValue) = dic(xValue) + 1
        xCount = dic(xValue)
        If xCount > xMax Then
            xMax = xCount
            xOutValue = xValue
        End If
    End If
Next
MsgBox "The most common value is: " & xOutValue & " Appeared " & xMax & " Times"
End Sub

3。 然後按 F5 鍵運行此代碼,然後會彈出一個提示框,提醒您選擇要使用的範圍。 看截圖:

4。 然後點擊 OK,您將得到一個提示框,其中顯示以下信息:


快速找到最逗號的值 (數字或文本字符串) 從列表/列中單擊幾下

如果您安裝了Kutools for Excel,則可以輕鬆應用其 找到最大的逗號值 快速從Excel列表或列中獲取最頻繁值的公式。

Excel的Kutools - 包含 300 多個 Excel 基本工具。 享受全功能 30 天免費試用,無需信用卡! 現在下載!

1。 選擇一個空白單元格,將找到的值放入其中,然後單擊 庫工具 > 公式助手> 公式助手.

2. 在“公式幫助器”對話框中,選擇 查找 來自 公式類型 下拉列表,單擊以選擇 尋找最普遍的價值 ,在 選擇一個公式 列錶框,在列表中指定列表/列 範圍 框中,然後單擊 Ok 按鈕。 看截圖:

然後,您將看到已找到最常見/最頻繁的值並將其放置在所選單元格中。 看截圖:

Excel的Kutools - 使用 300 多種基本工具增強 Excel 功能。 享受全功能 30 天免費試用,無需信用卡! 立即行動吧!


演示


Excel的Kutools:超過 300 個方便的工具觸手可及! 立即開始 30 天免費試用,沒有任何功能限制。 現在就下載!

相關文章:

最佳辦公生產力工具

🤖 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 (9)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
how to find which string used in maximum time in selected cell without blank in excel
This comment was minimized by the moderator on the site
hi,

how to do this with an horizontal arrangement? I am having and #N/A error.
This comment was minimized by the moderator on the site
Hi Catalina,
Both the VBA (the second method in above article) and the Find most common value formula provided by Kutools for Excel (the third method in above article) can find the most common value from a horizontal row.
This comment was minimized by the moderator on the site
Hi thanks, for the info. What if there is a sentence instead of a word? then also can we get the common words in all sentences??
This comment was minimized by the moderator on the site
Hi Adithya,
The array formula =INDEX($A$1:$A$16,MODE(MATCH($A$1:$A$16,$A$1:$A$16,0))) can also find out the most common sentence in a column.
However, please note that each sentence should be place in a single cell.
This comment was minimized by the moderator on the site
how to stop input in excel if enter value of cell larger than other cell
This comment was minimized by the moderator on the site
"Find the most common value (number or text string) from a list with Array Formula" will ignore blanks if modifying the above formula to: =INDEX(Range,MATCH(MAX(COUNTIF(Range,Range)),COUNTIF(Range,Range),0))
This comment was minimized by the moderator on the site
Trying to find the 'Find most common value' function. Not showing on the formulas drop down. Has it been removed ?
This comment was minimized by the moderator on the site
hi, after I found 4 or 5 values of most common word in the list, the vba code returns the same value although I delete the value from the list. ex: a a b b b c c c c d first returns c - 4 delete c second returns b - 3 delete b third returns a - 2 delete a fourth returns a - 2 way not d -1 ? 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