=GPT_CLASSIFY() — put each row into one category
=GPT_CLASSIFY() reads a text and returns exactly one of the categories you define. It replaces manual triage: sentiment analysis, support-ticket routing, product taxonomy — drag it down a column and every row gets sorted. Part of GPT for Sheets.
Syntax
=GPT_CLASSIFY(value, categories)
| Parameter | Required | Description |
|---|---|---|
value |
yes | The text to classify — a string or a cell reference. |
categories |
yes | The allowed categories, e.g. "fruit, vegetable". Comma-separated values or a range. |
Examples
Sentiment analysis on customer reviews in A2:
=GPT_CLASSIFY(A2, "positive, negative, neutral")
Route support tickets by topic:
=GPT_CLASSIFY(A2, "billing, bug, feature request, other")
Sort products into your shop’s taxonomy kept in F1:F20 (a range works as categories):
=GPT_CLASSIFY(A2, $F$1:$F$20)
Qualify inbound leads from a “How did you hear about us?” answer:
=GPT_CLASSIFY(A2, "search, social media, referral, ads, unknown")
Tips
- Always include a catch-all like
otherorunknown— otherwise borderline rows get forced into a wrong bucket. - Keep category names short and distinct; overlapping labels (“sales” vs “business”) produce inconsistent picks.
- Drag the formula down for bulk runs — up to 10,000 results per hour — then use Replace all GPT formulas with results in the sidebar to freeze the answers.
- Need multiple labels per row instead of one? Use =GPT_TAG().
Related functions
- =GPT_TAG() — several labels per text instead of one category
- =GPT_EXTRACT() — pull values out of text
- =GPT_SUMMARIZE() — condense long text before classifying
Try it
=GPT_CLASSIFY() ships with GPT for Sheets — no API keys needed. Install the add-on from the Google Workspace Marketplace.