跳到主要內容

如何在Excel中根據關鍵字對文本字符串進行分類?

假設我在A列中有一個文本字符串列表,現在,我想基於D列中的關鍵字對A列中的文本字符串進行分類。例如,對包含Kutools的所有單元格進行分類 Extendoffice,將包含足球,籃球的單元分配給運動,依此類推,如下所示。 如何在Excel中快速輕鬆地完成這項複雜的工作?

根據具有數組公式的關鍵字對文本字符串列表進行分類


辦公室標籤圖片

裁員季節快到了,工作還在嗎?
-- Office Tab 加快步伐,節省50%的工作時間!

  •  驚人! 多個文檔的操作比單個文檔更加輕鬆和方便。
  •  與其他Web瀏覽器相比,Office Tab的界面更強大,更美觀。
  •  減少數千次繁瑣的鼠標點擊,告別頸椎病和鼠標手;
  •  被90,000名精英和300多家知名公司選中!
功能齊全,免費試用30天          閱讀更多             現在就下載!
 

根據具有數組公式的關鍵字對文本字符串列表進行分類

要根據某些關鍵字對文本字符串進行分類,可以應用以下數組公式:

1。 首先,您應該根據需要對數據進行分類。 例如,我將數據分類為如下所示的屏幕截圖:

2。 請輸入以下公式或將其複製到空白單元格中:

=INDEX($E$2:$E$8,MATCH(TRUE,ISNUMBER(SEARCH($D$2:$D$8,A2)),0))
  • 保養竅門:在此公式中:
  • $ E $ 2:$ E $ 8:是您要分配給文本字符串的類別;
  • $ D $ 2:$ D $ 8:是您要基於其進行分類的特定文本;
  • A2:是單元格包含要分類的文本字符串。

3。 然後按 Ctrl + Shift + Enter 鍵在一起,您將得到第一個結果,然後將填充手柄向下拖動到要應用此公式的單元格上,並且根據需要將所有文本字符串分類為特定組。 看截圖:


下載樣本文件

點擊下載示例文件!


更多相關的文字類別文章:

  • 根據Excel中的值對數據進行分類
  • 假設您需要根據值對數據列表進行分類,例如,如果數據大於90,則將其分類為“高”,如果數據大於60且小於90,則將其分類為“中”,如果為小於60,歸類為“低”,您如何在Excel中解決此任務?
  • 根據數字範圍分配值或類別
  • 本文討論的是在Excel中分配與指定範圍相關的值或類別。 例如,如果給定的數字在0到100之間,則分配值5;如果在101到500之間,則分配10;對於501到1000,則分配15。本文中的方法可以幫助您解決問題。
  • 在Excel中計算或分配字母等級
  • 根據學生的分數為每個學生分配字母等級可能是教師的一項常見任務。 例如,我定義了一個評分等級,其中分數0-59 = F,60-69 = D,70-79 = C,80-89 = B和90-100 = A,如下圖所示。 在Excel中,如何快速,輕鬆地根據數字分數計算字母等級?
  • 將序列號分配給重複值或唯一值
  • 如果您有一個包含一些重複項的值列表,我們是否可以為重複項或唯一值分配順序號? 這意味著給重複值或唯一值給出一個順序。 本文中,我將討論一些簡單的公式來幫助您解決Excel中的這一任務。

  • 超級公式欄 (輕鬆編輯多行文本和公式); 閱讀版式 (輕鬆讀取和編輯大量單元格); 粘貼到過濾範圍...
  • 合併單元格/行/列 和保存數據; 拆分單元格內容; 合併重複的行和總和/平均值...防止細胞重複; 比較範圍...
  • 選擇重複或唯一 行; 選擇空白行 (所有單元格都是空的); 超級查找和模糊查找 在許多工作簿中; 隨機選擇...
  • 確切的副本 多個單元格,無需更改公式參考; 自動創建參考 到多張紙; 插入項目符號,複選框等...
  • 收藏并快速插入公式,範圍,圖表和圖片; 加密單元 帶密碼 創建郵件列表 並發送電子郵件...
  • 提取文字,添加文本,按位置刪除, 刪除空間; 創建和打印分頁小計; 在單元格內容和註釋之間轉換...
  • 超級濾鏡 (將過濾方案保存並應用於其他工作表); 高級排序 按月/週/日,頻率及更多; 特殊過濾器 用粗體,斜體...
  • 結合工作簿和工作表; 根據關鍵列合併表; 將數據分割成多個工作表; 批量轉換xls,xlsx和PDF...
  • 數據透視表分組依據 週號,週幾等 顯示未鎖定的單元格 用不同的顏色 突出顯示具有公式/名稱的單元格...
kte選項卡201905
  • 在Word,Excel,PowerPoint中啟用選項卡式編輯和閱讀,發布者,Access,Visio和Project。
  • 在同一窗口的新選項卡中而不是在新窗口中打開並創建多個文檔。
  • 將您的工作效率提高 50%,每天為您減少數百次鼠標點擊!
officetab底部
Comments (10)
Rated 5 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
Thanks for the tips of index how to use, But I have a extend question:
If I wanna sort like "aaaaa" to "row B" & "row C",
gonna be "3a" & "2a" (or"2a" & "3a")
So I use the function "=INDEX(E3:E4,MATCH(TRUE,ISNUMBER(SEARCH(D3:D4,A3)),0))"
(D3 is "aaa", E3 is "3a"; D3 is "aa", D4 is "2a")
The result is "3a" & "3a" in "row B" & "row C"...
Could you make some solutions to this problem? I am so appreciate it.
Rated 5 out of 5
This comment was minimized by the moderator on the site
Is there a way to have a multi word keyword?
Ex: I'm trying to sort out the rows that have "patient ID". However, my keyword "patient id" pulls every row with "patient."
This comment was minimized by the moderator on the site
I have a doubt.I have the data in Sheet 1 ,I want to create the category table in sheet 2 and want the categorized date to be entered in sheet 3. How may i do that
This comment was minimized by the moderator on the site
Hello, Gokul Prakash
Could you give more detailed information of your probelm?
Or you can insert an attachment file or screenshot here to explain your task.
Thank you!
This comment was minimized by the moderator on the site
Doesn't work for me either. I only get "problem with formular". I rebuild your Excel and it also doesn't work there. I don't know if the Problem is "Ctrl + Shift + Enter" i tried everything but nothing works, is there a go around for the key combination?
could you maybe up load your example.

thank you very much
This comment was minimized by the moderator on the site
Hi, Rocket,I have uploaded the attachment file at the end of this article, please download to view.If you have any other problem, please comment here, thank you!
This comment was minimized by the moderator on the site
Doesn't work for me either. I only get "problem with formular". I rebuild your Excel and it also doesn't work there. I don't know if the Problem is "Ctrl + Shift + Enter" i tried everything but nothing works, is there a go around for the key combination?could you maybe up load your example.
hank you very much
This comment was minimized by the moderator on the site
This doesn't work for me. Is it because the keyword may be within the string of text, and not the beginning key word? 
This comment was minimized by the moderator on the site
Hi, Taren,The formula also works well if the keyword is in the middle of the text string, do you remember to press the Ctrl + Shift + Enter keys together after you insert the formula?Please check it, thank you!
This comment was minimized by the moderator on the site
How can you make it such that the match/index references are updated automatically? If I refer to entire column instead of only the cells that contain the values I get a zero as result
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations