跳到主要內容

如何在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)))
  • 保養竅門:在此公式中:
  • 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))))
  • 保養竅門:在此公式中:
  • 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))
  • 保養竅門:在此公式中:
  • B2:B15:是您要查找名稱出現次數最多的數據列表。
  • A2:A15 <= E2:是小於或等於您要基於其查找名稱的特定日期的日期範圍。
  • A2:A15> = D2:是大於或等於您要基於其查找名稱的特定日期的日期範圍。

2。 然後,按 Ctrl + Shift + Enter 鍵一起,已提取出特定兩個日期之間最頻繁出現的名稱,請參見屏幕截圖:


相對最常見的文字文章:

  • 基於頻率的條件格式(最常見的數字/文本)
  • 例如,您要有條件地格式化範圍中最頻繁使用的單元格,如何快速在Excel中解決呢? 如果根據指定列中的值的頻率有條件地格式化整個行怎麼辦? 本文提供了兩種解決方法。
  • 在Excel中查找第二個最常用/最常用的數字或文本
  • 我們可以應用MODE函數在Excel中輕鬆地從一個範圍中找出最頻繁的數字。 但是,如何從列中找出第二高頻率的數字呢? 如果從一列中找出第二個最常見的文本值怎麼辦? 在這裡,我們為您提供一些解決方法。
  • 從Excel中的列表中查找最常見的值(數字或文本字符串)
  • 假設您有一個包含一些重複項的名稱列表,現在,您要提取出現頻率最高的值。 直接的方法是從列表中逐一計算數據以獲得結果,但是如果列中有成千上萬個名稱,這種方法將很麻煩且耗時。 以下教程將向您介紹一些技巧,可以快速方便地解決此任務。
  • 按Excel中最頻繁的值對數據進行排序
  • 假設您的工作表中有一長串數據,現在您想按每個單詞出現的頻率對該列表進行排序。 也就是說,首先列出最常見的值(例如,在該列中出現四次),然後緊跟其後的單詞出現三遍,兩次和一次,如下面的屏幕截圖所示。 您如何在Excel中解決此任務?
  • 在Google表格的列表中查找最常見的文本值
  • 現在,如果您的單元格列表很長,其中包含一些重複的值,那麼您希望找到出現在Google表格數據列表中的最常見的文本值。 您如何不逐一檢查就能完成這項工作?

  • 超級公式欄 (輕鬆編輯多行文本和公式); 閱讀版式 (輕鬆讀取和編輯大量單元格); 粘貼到過濾範圍...
  • 合併單元格/行/列 和保存數據; 拆分單元格內容; 合併重複的行和總和/平均值...防止細胞重複; 比較範圍...
  • 選擇重複或唯一 行; 選擇空白行 (所有單元格都是空的); 超級查找和模糊查找 在許多工作簿中; 隨機選擇...
  • 確切的副本 多個單元格,無需更改公式參考; 自動創建參考 到多張紙; 插入項目符號,複選框等...
  • 收藏并快速插入公式,範圍,圖表和圖片; 加密單元 帶密碼 創建郵件列表 並發送電子郵件...
  • 提取文字,添加文本,按位置刪除, 刪除空間; 創建和打印分頁小計; 在單元格內容和註釋之間轉換...
  • 超級濾鏡 (將過濾方案保存並應用於其他工作表); 高級排序 按月/週/日,頻率及更多; 特殊過濾器 用粗體,斜體...
  • 結合工作簿和工作表; 根據關鍵列合併表; 將數據分割成多個工作表; 批量轉換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