跳到主要内容

如何从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排序

Kutools for Excel - 使用 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的列表或列中获取最频繁值的公式。

Kutools for Excel - 包含 300 多个 Excel 基本工具。 享受全功能 30 天免费试用,无需信用卡! 现在下载!

1。 选择一个空白单元格,将找到的值放入其中,然后单击 库工具 > 公式助手> 公式助手.

2. 在“公式帮助器”对话框中,选择 查找 来自 公式类型 下拉列表,单击以选择 寻找最普遍的价值 ,在 选择一个公式 列表框,在列表中指定列表/列 范围 框,然后单击 Ok 按钮。 看截图:

然后,您将看到已找到最常见/最频繁的值并将其放置在所选单元格中。 看截图:

Kutools for Excel - 使用 300 多种基本工具增强 Excel 功能。 享受全功能 30 天免费试用,无需信用卡! 立即行动吧!


演示


Kutools for Excel:超过 300 个方便的工具触手可及! 立即开始 30 天免费试用,没有任何功能限制。 立即下载!

相关文章:

最佳办公生产力工具

🤖 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 (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