Skip to main content

Kutools for Office — One Suite. Five Tools. Get More Done.

How to categorize text strings based on keywords in Excel?

Author Xiaoyang Last modified

Supposing, I have a list of text strings in Column A, now, I want to categorize the text strings in Column A based on the keyword in Column D. For example, to categorize all cells which contain Kutools to Extendoffice, assign the cells contain football, basketball to Sport, and so on as following screenshot shown. How could I finish this complicated job quickly and easily in Excel?

categorize text strings based on keywords

Categorize list of text strings based on keywords with array formula


Categorize list of text strings based on keywords with array formula

To categorize the text strings based on some keywords, you can apply the below array formula:

1. First, you should categorize the data as you need. For example, I will categorize the data as below screenshot shown:

sample data

2. Please enter or copy the following formula into a blank cell:

=INDEX($E$2:$E$8,MATCH(TRUE,ISNUMBER(SEARCH($D$2:$D$8,A2)),0))
  • Tips: In this formula:
  • $E$2:$E$8: is the category that you want to assign to the text strings;
  • $D$2:$D$8: is the specific text you want to categorize based on;
  • A2: is the cell contains the text string that you want to be categorized.

3. And then press Ctrl + Shift + Enter keys together, and you will get the first result, then, drag the fill handle down to the cells that you want to apply this formula, and all text strings have been categorized as the specific group as you need. See screenshot:

Categorize list of text strings based on keywords with array formula

a screenshot of kutools for excel ai

Unlock Excel Magic with Kutools AI

  • Smart Execution: Perform cell operations, analyze data, and create charts—all driven by simple commands.
  • Custom Formulas: Generate tailored formulas to streamline your workflows.
  • VBA Coding: Write and implement VBA code effortlessly.
  • Formula Interpretation: Understand complex formulas with ease.
  • Text Translation: Break language barriers within your spreadsheets.
Enhance your Excel capabilities with AI-powered tools. Download Now and experience efficiency like never before!

Download sample file

Click to download the sample file!


More relative text category articles:

  • Categorize Data Based On Values In Excel
  • Supposing, you need to categorize a list of data based on values, such as, if data is greater than 90, it will be categorized as High, if is greater than 60 and less than 90, it will be categorized as Medium, if is less than 60, categorized as Low, how could you solve this task in Excel?
  • Assign A Value Or Category Based On A Number Range
  • This article is talking about assigning value or category related to a specified range in Excel. For example, if the given number is between 0 and 100, then assign value 5, if between 101 and 500, assign 10, and for range 501 to 1000, assign 15. Method in this article can help you get through it.
  • Calculate Or Assign Letter Grade In Excel
  • To assign letter grade for each student based on their scores may be a common task for a teacher. For example, I have a grading scale defined where the score 0-59 = F, 60-69 = D, 70-79 = C, 80-89 = B, and 90-100 = A as following screenshot shown. In Excel, how could you calculate letter grade based on the numeric score quickly and easily?
  • Assign Serial Number To Duplicate Or Unique Values
  • If you have a list of values which contains some duplicates, is it possible for us to assign sequential number to the duplicate or unique values? It means giving a sequential order for the duplicate values or unique values. This article, I will talk about some simple formulas to help you solving this task in Excel.

  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns and Keeping Data; Split Cells Content; Combine Duplicate Rows and Sum/Average... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Favorite and Quickly Insert Formulas, Ranges, Charts and Pictures; Encrypt Cells with password; Create Mailing List and send emails...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • Pivot Table Grouping by week number, day of week and more... Show Unlocked, Locked Cells by different colors; Highlight Cells That Have Formula/Name...
kte tab 201905
  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
officetab bottom