AI_CLASSIFY
Classify text into one of the provided categories using AI
=AI_CLASSIFY(text, categories)Gibt zurück: string
Übersicht
AI_CLASSIFY assigns a category label to any text based on a list of categories you define. Pass in a piece of text — a customer review, a support ticket, a social media mention, a product description — along with a comma-separated list of your categories, and the function returns the single most appropriate category. It is the simplest, most focused AI function in the Unlimited Sheets toolkit, designed to do one thing exceptionally well: sort text into the buckets you care about.
Parameter
| Parameter | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
text | string | Ja | The text to classify. Can be a cell reference containing any text content — reviews, tickets, messages, descriptions, etc. |
categories | string | Ja | A comma-separated list of category labels the text should be classified into. The function returns exactly one of these categories. |
Beispiele
Sentiment analysis on customer reviews
Classifies a customer review as Positive, Negative, or Neutral.
=AI_CLASSIFY(A2, "Positive, Negative, Neutral")Eingabe
| The product quality is amazing but delivery was slow. Overall happy with my purchase. |
Ausgabe
PositiveRoute support tickets by topic
Automatically routes support tickets to the right team by classifying the topic.
=AI_CLASSIFY(A2, "Billing Issue, Bug Report, Feature Request, Account Access, General Inquiry")Eingabe
| I was charged twice for my subscription this month. Can you issue a refund for the duplicate charge? |
Ausgabe
Billing IssueClassify job applications by department
Sorts incoming applications into department categories based on the cover letter or resume summary.
=AI_CLASSIFY(A2, "Engineering, Design, Marketing, Sales, Operations, Finance")Eingabe
| Experienced full-stack developer with 5 years of React and Node.js experience looking for a senior engineering role. |
Ausgabe
EngineeringDetect email intent
Classifies inbound emails by intent to prioritize responses.
=AI_CLASSIFY(A2, "Purchase Intent, Support Request, Partnership Inquiry, Spam, Newsletter Signup")Eingabe
| We would love to explore a potential integration between our platforms. Would your team be open to a partnership call? |
Ausgabe
Partnership InquiryContent type detection
Automatically tags content pieces by type for a content management system.
=AI_CLASSIFY(A2, "How-To Guide, Product Review, News Article, Opinion Piece, Case Study, Tutorial")Eingabe
| In this article, we walk you through setting up your first CI/CD pipeline using GitHub Actions, step by step with code examples. |
Ausgabe
TutorialAnwendungsfälle
Customer Feedback Triage
Automatically classify incoming customer feedback into categories like Product, Service, Pricing, UX, and Delivery to route issues to the appropriate team and identify trending complaint areas.
Social Media Monitoring
Classify social media mentions by sentiment and topic to understand brand perception in real time. Flag negative mentions for immediate response while tracking positive sentiment trends.
Content Tagging for CMS
Automatically tag articles, blog posts, and media content by topic, format, and audience segment to improve content organization and discovery on your website.
Lead Scoring and Qualification
Classify inbound lead messages as Hot, Warm, or Cold based on the language and intent expressed, enabling sales teams to prioritize follow-ups on the most promising opportunities.
Survey Response Categorization
Categorize open-ended survey responses into themes (e.g., pricing concerns, feature requests, competitor mentions) to quantify qualitative feedback across thousands of responses.
Document Classification for Compliance
Sort legal documents by type — contracts, amendments, NDAs, notices, invoices — to ensure proper filing, retention policies, and review workflows are applied automatically.
Profi-Tipps
Add an "Other" category to your list as a catch-all. This prevents the AI from forcing a poor fit when the text truly does not match any of your defined categories.
Use COUNTIF on the classified column to instantly see the distribution of categories. Combine with a pivot table or chart for a visual dashboard of your classification results.
Store your categories in a single cell (e.g., D1 = "Bug, Feature, Billing, Other") and reference that cell in all AI_CLASSIFY formulas. This way, updating your category list in one place updates all formulas simultaneously.
For sentiment analysis, use more granular categories than just "Positive" and "Negative". Try "Very Positive, Positive, Neutral, Negative, Very Negative" for a 5-point sentiment scale that captures nuance.
Test your category list on a small sample first. If the AI frequently picks the wrong category, your labels might be too similar or ambiguous. Rename categories to be more distinct and descriptive.
The strength of AI_CLASSIFY is its flexibility. You define the categories, and the AI understands them semantically. Unlike rule-based classification that depends on keyword matching (and breaks when customers use unexpected phrasing), AI_CLASSIFY understands meaning and context. A customer writing "the widget stopped working after a week" gets correctly classified as "Product Issue" even though neither of those exact words appears in the complaint. Categories can be as broad as "Positive, Negative, Neutral" for sentiment analysis or as specific as "Billing Issue, Feature Request, Bug Report, Account Access, General Inquiry" for support ticket routing.
AI_CLASSIFY is designed for high-throughput classification workflows. Place your text in one column, define categories once in a cell or directly in the formula, and drag down to classify hundreds or thousands of rows instantly. Because it returns a single string (the category name), the output is immediately usable with COUNTIF, FILTER, pivot tables, and conditional formatting. This makes it the fastest path from raw unstructured text to actionable, filterable, analyzable data in your spreadsheet. For more complex classification where you need to learn from examples rather than predefined categories, use AI_FILL instead.
Häufige Fehler
#ERROR! Categories list is emptyUrsache: The categories parameter is empty or references an empty cell.
Lösung: Provide a comma-separated list of categories. Example: "Positive, Negative, Neutral". Ensure the cell reference contains text if you are referencing a cell.
#VALUE! Text is emptyUrsache: The text parameter is empty or references an empty cell.
Lösung: Provide text to classify. Ensure the referenced cell contains content. Check for formulas that might return empty strings.
#ERROR! Too many categoriesUrsache: The categories list contains an extremely large number of options, exceeding practical limits.
Lösung: Reduce your category list to 20 or fewer options. For more categories, use a hierarchical approach: classify into broad groups first, then sub-classify.
Häufig Gestellte Fragen
AI_CLASSIFY always returns exactly one category — the most appropriate match based on the overall text meaning. If you need multi-label classification (assigning multiple categories), use UNLIMITED_AI with a prompt like "Which of these categories apply to this text? Return all that apply: [categories]".
There is no hard limit, but accuracy tends to decrease with too many categories. Up to 15-20 categories works well. Beyond that, consider creating a hierarchical classification: first classify into broad groups, then sub-classify each group with a second AI_CLASSIFY call.
Yes, descriptive category names produce better results. "Billing Issue" works better than "Type A". The AI uses the semantic meaning of category names to understand what belongs in each. Use clear, human-readable labels.
Yes, AI_CLASSIFY works with text in any language supported by the underlying AI model. You can classify Spanish text into English categories, or use categories in the same language as the input text. Both approaches work well.
AI_CLASSIFY uses predefined category labels — you tell it the categories upfront. AI_FILL learns categories from examples — you show it what category each example belongs to. Use AI_CLASSIFY when you know your categories and have clear labels. Use AI_FILL when the categorization pattern is complex and better demonstrated through examples.
AI_CLASSIFY returns only the category label for simplicity. If you need confidence scores, use UNLIMITED_AI with a prompt like "Classify this text and include a confidence percentage: [text]. Categories: [list]".
The function will always return one of the provided categories, choosing the closest match. To handle edge cases, add an "Other" or "Uncategorized" option to your category list. This gives the AI a safe fallback for text that does not clearly match any specific category.
Even short texts (a single sentence) can be classified accurately when the meaning is clear. However, very short or ambiguous texts (1-2 words) may produce inconsistent results. For best accuracy, provide at least a full sentence of context.
Verwandte Funktionen
Beginnen Sie noch heute mit AI_CLASSIFY
Installieren Sie Unlimited Sheets, um AI_CLASSIFY und 41 weitere leistungsstarke Funktionen in Google Sheets zu erhalten.