← All posts

STAYCHARTED BLOG · EXCEL · GOOGLE SHEETS · AI CATEGORIZATION

How to categorize rows in Excel and Google Sheets with AI

Compare five ways to categorize Excel rows with AI or formulas. Use your past examples to classify new rows in Excel and Google Sheets without code.

By Manoj Mohandas ·

Five ways to categorize rows

Option What it needs from you Good for Watch for
1. Keyword formulas (IF, SEARCH, XLOOKUP) A list of words and the category each one means Clear rules: "contains 'refund'" means Billing Breaks on new wording; the list keeps growing
2. Copilot in Excel A Microsoft 365 Copilot license Exploring a column, suggesting categories Answers in a chat, not a repeatable formula
3. AI function in Google Sheets An eligible Workspace or Google AI plan A few hundred cells with a clear prompt 350 cells per run; needs your definitions and context
4. Pasting into ChatGPT or Claude A chat account A one-off look at a few dozen rows Copying in and out; different answers for different people
5. A model trained on your own rows Rows your team already categorized Repeated work, thousands of rows, your own categories Needs past examples to learn from

Option 1: keyword formulas

The classic way. You keep a small table of keywords and categories, and a formula looks up each row. For example, a nested IF with SEARCH: if the text contains "refund", write "Billing"; if it contains "password", write "Account access". Or use XLOOKUP against a keyword table.

When it's enough:

  • the categories follow clear words;
  • there are only a handful of them;
  • the text is short and written the same way each time, such as bank transaction descriptions from one bank.

Where it breaks: people don't write the way your keyword list expects. "I was charged twice" contains no "refund". "Can't get in" contains no "password". So every week someone adds keywords, and the formula still sends the odd ones to the wrong place without any warning.

Option 2: Copilot in Excel

Microsoft 365 Copilot in Excel can now look at a column of text, such as survey answers or customer feedback, and suggest categories or tags for each entry. It needs a Microsoft 365 Copilot license.

The =COPILOT() formula, which let you call the AI from a cell, has been withdrawn. Microsoft retired it on 14 September 2026, and points people to the Copilot side pane instead.

When it's enough: you want to explore a column once, see what themes are in it, and get a first set of categories. It works well for that.

Watch for:

  • Copilot can use categories and examples you supply, but a prompt is not a model trained and evaluated on your history.
  • It works in a chat pane rather than a formula you can run on next week's rows the same way.
  • It doesn't tell you how often it's right on your own data.

Option 3: the AI function in Google Sheets

Google Sheets has an AI function (=AI("prompt", range), also written =Gemini()). You write a prompt such as "Categorize this ticket as Billing, Account access or Technical", point it at a cell, and it writes an answer.

When it's enough: a few hundred rows, simple categories, and a prompt that explains them well.

Watch for:

  • It needs an eligible Google Workspace or Google AI plan, and your admin may have turned it off.
  • Only the first 350 selected cells generate at a time. There are also daily limits, and when you hit one you wait 24 hours.
  • It uses the prompt and range you supply. You can include past examples, but it does not automatically train and test a model on your history.

Option 4: pasting into ChatGPT or Claude

Copy a column into ChatGPT or Claude, list the categories, and ask it to sort them.

When it's enough: a one-off look at 30 or 50 rows, or working out what the categories should be in the first place.

Watch for: past a few dozen rows, you're copying back and forth. Two colleagues write two different prompts and get two different answers. Nothing tells you how accurate it is. If you want ChatGPT or Claude to do this properly at volume, use their API instead of the chat window; we explain how without code in How to use the OpenAI and Claude API without coding.

Option 5: a model trained on your own rows

The other options rely on rules, prompts or the context you supply. This one starts from your team's past decisions: a few hundred rows you already categorized, in the same spreadsheet. A model learns from those examples, is tested on rows it hasn't seen, and then fills the new ones the same way your team would.

Why examples matter: when we gave Claude only category names and a one-line definition of each, it categorized 3,080 real banking support messages correctly 84.7% of the time. A model trained on the team's own examples got 93.7%, with fewer than half the mistakes. Claude's misses were about the team's conventions, not about understanding the messages. On medical abstracts, where the categories follow general knowledge, Claude did better than the trained model. Read the benchmark →

When it's the right choice:

  • the same column gets filled again every week or month;
  • the categories are your team's own, such as your queues, your expense types or your product groups;
  • you have past examples. About 20 per category is enough to start.

Which to choose

  • A handful of clear categories, consistent text: a keyword formula is fine.
  • A one-off look at a new column: Copilot, the Sheets AI function or a chat assistant.
  • Your own categories, new rows every week, more than a few hundred rows: a model trained on your past rows, tested before you rely on it.
  • Not sure: try two. Test both on rows your team already categorized and count how many each gets right.

Step by step: categorize your spreadsheet with a model trained on your rows

This uses StayCharted AI Model Trainer. There's no code and no formulas.

Step 1. Get your past rows ready

You need one row for each item, a column that describes it (the ticket text, the invoice line, the product title) and a column with the answer your team gave. Aim for about 20 examples of each answer. Save it as Excel (.xlsx), CSV or JSON.

No answers yet? On Essentials and Business, StayCharted can group similar rows so you can name the groups and start from there.

Step 2. Upload it, and pick the columns

In StayCharted, choose New model, upload the file, and pick the column to read and the column with the answer. Before anything trains, StayCharted checks the file:

  • duplicates;
  • categories with too few examples;
  • category names that look like the same thing;
  • personal information such as emails and phone numbers, which you can mask in one click.

Step 3. Train it, and read the report

StayCharted holds back some of your rows and tests the model on them. The report shows how often it was right, category by category, and which categories it mixes up. If one category is weak, it usually needs more examples, or a clearer difference from the category it's confused with.

Step 4. Fill your new rows

Upload the new rows as a file, and download it with the answer column filled in and a _confidence column beside it. Rows the model isn't sure about are marked as worth a check. On Essentials and Business they also wait in the Review Queue, where a person confirms or corrects each one. Corrections go into the next version of the model.

In Google Sheets: no download, no upload

Install the StayCharted AI Model Trainer add-on from the Google Workspace Marketplace. Its sidebar trains a model from the sheet you have open. Then choose a published model and the column to fill:

  • only empty cells are filled;
  • a confidence column goes beside the answers;
  • answers worth a check are shaded and get a note.

Send the rows again after your team corrects some, and the next version learns from the corrections.

How StayCharted helps

StayCharted AI Model Trainer turns the column your team fills in by hand into a model that fills it for you. You can see how often it's right before you rely on it, and the answers it's unsure about go to a person.

  • Learns from your rows. It learns your own categories, not a generic list.
  • Tested first. Accuracy per category, on rows it never saw.
  • Fills files and sheets. Excel, CSV and JSON files, and Google Sheets through the add-on.
  • Plain about uncertainty. A confidence on every answer, and on Essentials and Business, a Review Queue for a person to check.
  • Grows with the work. Call the same model from your own systems through the API, or through Zapier, Make or Power Automate (Essentials and Business).

Free plan: one workspace with up to 3 models, one of which can be an AI Classifier Model. It trains on up to 1,000 rows, and fills up to 10,000 rows a month, up to 5,000 in one file.

Don't have a file to hand? Open StayCharted, pick what you sort (emails and support tickets, products and catalog items, expenses and invoices, or document metadata), and press Try it with a sample first. It takes about two minutes.

Start free → · Get the Google Sheets add-on → · Compare plans →

Common questions

Can Excel categorize text automatically?

Yes, in a few ways. A keyword formula (IF with SEARCH, or XLOOKUP against a keyword table) works for clear, consistent text. Copilot in Excel can suggest categories for a text column, with a Microsoft 365 Copilot license. For your own categories at volume, a model trained on rows your team already categorized fills the column and gives a confidence for each row.

Is the COPILOT function still available in Excel?

No. Microsoft retired the =COPILOT() function on 14 September 2026, and recommends the Copilot side pane instead.

How do I categorize data in Google Sheets with AI?

Google Sheets' AI function works for a few hundred cells at a time (350 per run), with a prompt that describes the categories. To use your team's past decisions, train a model from the sheet with the StayCharted AI Model Trainer add-on and fill the empty rows.

How many examples do I need to train a model?

About 20 examples of each category is enough to start. More helps, especially for categories that look alike.

What if I don't have categorized examples yet?

Start by grouping. On Essentials and Business, StayCharted groups similar rows so you can name them. Or use Copilot or a chat assistant to explore the column and settle on categories, then categorize a few hundred rows by hand.

How accurate is AI at categorizing spreadsheet rows?

It depends on your categories. Where they follow general knowledge, a strong AI can do well from a description. Where they're your team's own conventions, learning from examples can do better: 93.7% against 84.7% on our banking benchmark. Always test on rows your team has already categorized.

Will it overwrite what my team already typed?

Not in Google Sheets: the add-on fills only empty cells, and skips rows that someone answered or changed while it ran. With files, you download a new filled copy and your original stays as it was.

Is my data used to train anyone else's model?

No. Your examples train only your workspace's models.

Sources and further reading

Put it into practice with StayCharted

Start free →

Check plans and allowances · Security and your data

Microsoft, Excel and Copilot are trademarks of the Microsoft group of companies. Google Sheets, Google Workspace and Gemini are trademarks of Google LLC. ChatGPT is a trademark of OpenAI, and Claude is a trademark of Anthropic. StayCharted is not affiliated with them.