跳到主要内容

如何在Excel中使用条件查找最常见的文本?

本文将讨论如何根据特定条件从Excel的一系列单元格中查找最多出现的文本。 同时,我还将介绍用于提取列中最频繁出现的文本的公式。

查找最常用的文字 根据条件查找最常见的文本

在具有数组公式的列中查找最频繁出现的文本

如果您只想从单元格列表中查找并提取最多出现的文本,请使用以下公式:

通用公式语法为:

=INDEX(range, MODE(MATCH(range, range, 0 )))
  • range: is the list of cells that you want to find the most frequent occurring text.

1。 输入此公式或将其复制到要输出结果的空白单元格中:

=INDEX(A2:A15,MODE(MATCH(A2:A15,A2:A15,0)))
  • Tips:在此公式中:
  • A2:A15:是您要查找文本出现次数最多的数据列表。

2。 然后,按 Ctrl + Shift + Enter 同时输入密钥,您将获得正确的结果,如下图所示:


根据具有数组公式的条件查找最频繁出现的文本

有时,您可能需要根据特定条件查找出现频率最高的文本,例如,您想要找到出现频率最高的名称,即Project是Project A,如下图所示:

通用公式语法为:

=INDEX(range1,MODE(IF(range2=criteria, MATCH(rang1,range1,0))))
  • range1: is the range of cells that you want to find the most frequent occurring text.
  • range2=criteria: is the range of cells contain the specific criteria that you want to find name based on.

1。 请输入以下公式或将其复制到空白单元格中:

=INDEX($B$2:$B$15,MODE(IF($A$2:$A$15=D2,MATCH($B$2:$B$15,$B$2:$B$15,0))))
  • Tips:在此公式中:
  • B2:B15:是您要查找名称出现次数最多的数据列表。
  • A2:A15 = D2:是包含您要查找文本的特定条件的单元格范围。

2.然后,按 Ctrl + Shift + Enter 同时,已提取项目A的最频繁出现的名称,请参见屏幕截图:


使用数组公式查找两个给定日期之间最频繁出现的文本

本节将讨论如何查找两个给定日期之间最常见的文本。 例如,要根据6/28/2019到7/5/2019之间的日期查找最常用的名称,以下数组公式可能会帮助您:

1。 请将以下公式应用于空白单元格:

=INDEX($B$2:$B$15, MATCH(MODE.SNGL(IF(($A$2:$A$15<=$E$2)*($A$2:$A$15>=$D$2), COUNTIF($B$2:$B$15, "<"&$B$2:$B$15), "")), COUNTIF($B$2:$B$15, "<"&$B$2:$B$15),0))
  • Tips:在此公式中:
  • B2:B15:是您要查找名称出现次数最多的数据列表。
  • A2:A15 <= E2:是小于或等于您要基于其查找名称的特定日期的日期范围。
  • A2:A15> = D2:是大于或等于您要基于其查找名称的特定日期的日期范围。

2。 然后,按 Ctrl + Shift + Enter 键一起,已提取出特定两个日期之间最频繁出现的名称,请参见屏幕截图:


相对最常见的文字文章:

  • 基于频率的条件格式(最常见的数字/文本)
  • 例如,您要有条件地格式化范围中最频繁使用的单元格,如何快速在Excel中解决呢? 如果根据指定列中的值的频率有条件地格式化整个行怎么办? 本文提供了两种解决方法。
  • 在Excel中查找第二个最常见/常见的数字或文本
  • 我们可以应用MODE函数在Excel中轻松地从一个范围中找出最频繁的数字。 但是,如何从列中找出第二高频率的数字呢? 如果从一列中找出第二个最常见的文本值怎么办? 在这里,我们为您提供一些解决方法。
  • 从Excel中的列表中查找最常用的值(数字或文本字符串)
  • 假设您有一个包含一些重复项的名称列表,现在,您要提取出现频率最高的值。 直接的方法是从列表中逐一统计数据以获得结果,但是如果列中有成千上万个名称,这种方法将很麻烦且耗时。 以下教程将向您介绍一些技巧,可以快速方便地解决此任务。
  • 按Excel中最频繁的值对数据进行排序
  • 假设您的工作表中有一长串数据,现在您想按每个单词出现的频率对该列表进行排序。 也就是说,首先列出最常见的值(例如,在该列中出现四次),然后紧跟其后的单词出现三次,两次和一次,如下面的屏幕快照所示。 您如何在Excel中解决此任务?

  • 超级公式栏 (轻松编辑多行文本和公式); 阅读视图 (轻松读取和编辑大量单元格); 粘贴到过滤范围...
  • 合并单元格/行/列 和保存数据; 拆分单元格内容; 合并重复的行和总和/平均值...防止细胞重复; 比较范围...
  • 选择重复或唯一 行; 选择空白行 (所有单元格都是空的); 超级查找和模糊查找 在许多工作簿中; 随机选择...
  • 确切的副本 多个单元格,无需更改公式参考; 自动创建参考 到多张纸; 插入项目符号,复选框等...
  • 收藏并快速插入公式,范围,图表和图片; 加密单元 带密码 创建邮件列表 并发送电子邮件...
  • 提取文字,添加文本,按位置删除, 删除空间; 创建和打印分页小计; 在单元格内容和注释之间转换...
  • 超级筛选 (将过滤方案保存并应用于其他工作表); 高级排序 按月/周/日,频率及更多; 特殊过滤器 用粗体,斜体...
  • 结合工作簿和工作表; 根据关键列合并表; 将数据分割成多个工作表; 批量转换xls,xlsx和PDF...
  • 数据透视表分组依据 周号,周几等 显示未锁定的单元格 用不同的颜色 突出显示具有公式/名称的单元格...
kte选项卡201905
  • 在Word,Excel,PowerPoint中启用选项卡式编辑和阅读,发布者,Access,Visio和Project。
  • 在同一窗口的新选项卡中而不是在新窗口中打开并创建多个文档。
  • 每天将您的工作效率提高50%,并减少数百次鼠标单击!
officetab底部
Comments (17)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hello, thank you for your help.
I've used the "Find the most frequent occurring text based on criteria with array formulas" which works well for the 14 rows of data in your example however, when I increase the rows (and the formula values to match with CTRL+SHIFT+ENTER) it is still only searching the first 14 rows and returning "N/A" searching for anything past row 14.

I appreciate your help
Thank you
This comment was minimized by the moderator on the site
Hallo, eine wunderbare Lösung, funktioniert auch super - nur in meinem speziellen Fall noch nicht ganz: wenn im Suchbereich auch Leerzellen sind, also z.B. hier bei "Name" im Bereich "Finden Sie den am häufigsten vorkommenden Text anhand von Kriterien mit Array-Formeln", da sind bei mir auch leere Zellen dabei. Schon kommt überall nur noch "#NV". Gibt es da eine Lösung, um trotzdem noch den häufigsten (Text)-Inhalt zu finden? Vielen Dank!
This comment was minimized by the moderator on the site
...bzw. mit der Formel aus #41657 kommt kein #NV mehr, dafür aber auch nur manchmal ein Ergebnis, was nicht Null ist. Manchmal kommt der richtige Wert, häufig halt nur "0". ..:Danke :-)
This comment was minimized by the moderator on the site
Bagaimana jika range yang kita cari terdapat kolom kosongnya? misal kita buat rumus paten raport, kita ingin mencari akhlak umumnya siswa, kita ambil jangkauan terjauh, misal dalam 1 kelas, jumlah maksimal anak 60. pada suatu kelas lain jumlah siswa cuma 50, sehingga kolom 51 sd 60 kosong. apakah rumus demikian masih valid? saya coba kok #N/A atau mohon pencerahannya!
This comment was minimized by the moderator on the site
Hi, This is great, what I found is that when there is tie or only one record the formula results in N/A. How do I get it to show the single result? this is when I want to find the most common value based on criteria.
This comment was minimized by the moderator on the site
Hello, Yeslam,
To solve your problem, please apply the follwoing formula:

=IFERROR(INDEX($B$2:$B$15,MODE(IF($A$2:$A$15=D2,MATCH($B$2:$B$15,$B$2:$B$15,0)))),INDEX(B2:B15,MATCH(D2,A2:A15,0)))

Please have a try, hope it can help you!
This comment was minimized by the moderator on the site
HEY! This is really helpful. I'm wondering if you could help me, with, if there is a tie, to pick one of the top values/strings. thanks!
This comment was minimized by the moderator on the site
This is really helpful. I'm just thinking how to do this with a third criteria for "Find the most frequent text based on criteria"? let say Inventory, Project, Name then get the most occured name.

Thank you so much!
This comment was minimized by the moderator on the site
Hello,
To apply the fromula for three criteria, please apply the below formula:
=INDEX($A$2:$A$12,MODE(IF($A$2:$B$12=F2,IF($C$2:$C$12=G2,IF($D$2:$D$12=H2,MATCH($A$2:$A$12,$A$2:$A$12,0))))))


Tips:If you have more criteria, you just need to add the IF criteria as below:
=INDEX(range,MODE(IF(range1=criteria1,IF(range2=criteria2,IF(range3=criteria3,... MATCH(rang,range,0))))))


Please have a try, hope it can help you!
This comment was minimized by the moderator on the site
Halo gan,
bagaimana cara menemukan teks yang paling sering keluar KEDUA, KETIGA dan seterusnya?
Terima kasih :)
This comment was minimized by the moderator on the site
Hello, Dodik,
To solve your problem, please use the following formulas: (Please remember to press Ctrl + Shift + Enter keys together to get the result)

Find the second most common value:
=INDEX(A1:A20,MODE(IF((A1:A20<>"")*(A1:A20<>INDEX(A1:A20,MODE(IF(A1:A20<>"",MATCH(A1:A20,A1:A20,0))))),MATCH(A1:A20,A1:A20,0))))

Find the third most common value:
=INDEX(A1:A20,MODE(IF(((A1:A20<>"")*(A1:A20<>INDEX(A1:A20,MODE(IF(A1:A20<>"",MATCH(A1:A20,A1:A20,0)))))*(A1:A20<>INDEX(A1:A20,MODE(IF((A1:A20<>"")*(A1:A20<>INDEX(A1:A20,MODE(IF(A1:A20<>"",MATCH(A1:A20,A1:A20,0))))),MATCH(A1:A20,A1:A20,0)))))),MATCH(A1:A20,A1:A20,0))))
This comment was minimized by the moderator on the site
Thank you for this information, but what happens if there is a tie? For the generic example, =INDEX(A2:A15,MODE(MATCH(A2:A15,A2:A15,0))), how would the formula be modified to output text indicating that a majority could not be determined?
This comment was minimized by the moderator on the site
Hello, Lauren

If there are more than one result, you can use the below formulas:
First, you can use this array formula: (Note: after inserting the formula, please press Ctrl + Shift + Enter keys together to get the first result.)
=INDEX($A$2:$A$10,MATCH(MIN(MODE(IF(NOT(COUNTIF(C$1:C1,$A$2:$A$10)),(COUNTIF($A$2:$A$10,"<"& $A$2:$A$10)+1)*{1,1}))),COUNTIF($A$2:$A$10,"<"& $A$2:$A$10)+{1},0))

With this formula, you can extract all data from the most occurred value to least common value.
And then, you should use the below formula to count the number of the occurred text:
=COUNTIF($A$2:$A$10, C2)


https://www.extendoffice.com/images/stories/comments/comment-skyyang/doc-most-common-value.png


Please try, hope it can help you!
This comment was minimized by the moderator on the site
Very helpful advice in this particular post! It’s the little changes that make the largest changes. Thanks for sharing!  
This comment was minimized by the moderator on the site
Thank you for your post, I look for such article along time, today i find it finally. this post give me lots of advise it is very useful for me. website
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations