top of page

How to categorize text with Fill with Gemini in Google Sheets

6 hours ago
9 min read
Cover with the title How to categorize text with Fill with Gemini in Google Sheets over a teal city skyline, Data Studios original cover

Fill with Gemini turns a column of free text into a column of categories without formulas you have to write yourself: you select the empty cells next to your comments, describe the labels you want, and Gemini fills each cell. Google documents Fill with Gemini as an entry point to the AI function in Sheets, so every generated label is model output subject to the same rules as any AI function result, and it needs a check before it feeds a pivot table, a dashboard or a report to management.


The practical case is common in support, product and operations teams: a few hundred survey answers, ticket summaries or review snippets that need a theme so they can be counted. Keyword formulas break as soon as customers phrase things differently. Fill with Gemini handles phrasing, but it can also invent a label outside your list, read an ambiguous comment differently from your team, or return a slightly different spelling that splits one category into two in a pivot table.


The workflow below uses a twelve-row illustrative dataset with a known answer key, a prompt that constrains the output to a fixed list, and three checks that catch the typical errors: labels outside the list, wrong labels, and drift between batches. All requirements and limits were verified on Google's official Help Center pages and Workspace Updates posts on November 16, 2026.


··········


⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣

FILL WITH GEMINI AND THE AI FUNCTION IN GOOGLE SHEETS.


Google's Help Center describes two ways to start Fill with Gemini. With drag-and-drop, if a column already has at least one completed cell, you drag the fill handle and Sheets fills the rest of the column based on the table's context. With prompt-based filling, you select a range of empty cells and a one-click Fill option appears; the cells can fill automatically from the completed examples, or you can write a custom prompt. The April 22, 2026 Workspace Updates post that introduced the feature states that Fill with Gemini is an entry point to the existing AI function in Sheets.


The AI function itself has the syntax AI("prompt", [range]), and Sheets also accepts the name Gemini in place of AI. You can type it in a cell or insert it from Insert > Function > AI, then select the cells and click Generate and Insert. To produce new output later you click Refresh and Insert. The Help Center does not describe automatic recalculation: output is generated when you ask for it, and Google notes that when a prompt concatenates references you do not get a refresh prompt if the data changes, so you decide when to refresh.


There is a third, older feature with a similar name. Enhanced Smart Fill with Gemini detects the relationship between incomplete column pairs and suggests the remaining values after at least three example rows with two distinct values. Google lists "categorize feedback by theme" among its use cases, but its help page says it works only on text columns, detects and supports only English values, and runs on desktop only. For a controlled categorization with a fixed label list, the prompt-based route through Fill with Gemini or the AI function gives you more control over the instruction.


··········


WHO CAN USE FILL WITH GEMINI: PLANS, LIMITS AND ADMIN SETTINGS.


The table summarizes what Google's official pages state as of November 16, 2026. Availability can change with each Workspace rollout, so confirm in the Admin console before planning team-wide use.


........


Item

What Google documents

Workspace editions

Business Standard and Plus; Enterprise Standard and Plus

Add-ons

AI Expanded Access; Google AI Pro for Education

Consumer plans

Google AI Pro and Ultra

Admin control

Hidden if Smart features for Google Workspace is turned off

Request size

Up to 3,000 cells per request (October 28, 2026 update)

AI function cells

First 350 selected AI function cells generated per selection

Usage limits

Short-term and long-term limits; wait 24 hours after a long-term limit

Web sources

Cell-level sources in Sheets on the web only


........


The two size figures come from different pages and describe different actions. The October 28, 2026 Workspace Updates post says Fill with Gemini now supports up to 3,000 cells per request, with a gradual rollout that began on October 20, 2026. The AI function help page says only the first 350 selected cells that contain AI functions are generated per selection, and that you can select more after generation completes. For a dataset of a few hundred rows either limit is comfortable; for several thousand rows, plan to work in batches and check each batch.


The AI function help page also lists limits that affect categorization work. Responses are text only. The function cannot read your whole spreadsheet or other Drive files, so any context it needs, such as the list of allowed categories, must be in the prompt or in a referenced range. Functions cannot be undone or redone, only regenerated. AI functions nested inside another function, for example inside IF, are not supported. Spreadsheets opened through Box, Dropbox or Egnyte with Google Drive cannot generate AI content. If you see "AI function not available", Google points to admin settings or the account language setting as likely causes.


··········


WORKED EXAMPLE: CATEGORIZING SUPPORT COMMENTS WITH FILL WITH GEMINI.


The dataset below is illustrative: twelve customer comments from a fictional online clothing store, each with the category a reviewer assigned. The answer key column is what you would build for a small sample of real data before trusting the AI on the full column. The four allowed categories are Billing, Shipping, Product quality and Account access.


........


ticket_id

comment

Answer key

101

I was charged twice for my October invoice

Billing

102

The package arrived five days after the promised date

Shipping

103

Cannot log in since the password reset email never came

Account access

104

The zipper broke after two weeks of normal use

Product quality

105

Why did my monthly price go up without notice

Billing

106

Tracking number shows delivered but nothing is at my door

Shipping

107

The two-factor code expires before I can type it

Account access

108

Color faded after the first wash

Product quality

109

Refund for the returned jacket still not on my card

Billing

110

Box was crushed and one item was missing

Shipping

111

Stitching came loose on the left sleeve

Product quality

112

My account was locked after one wrong password

Account access


........


Put ticket_id in column A, the comment in column B, leave column C empty for the AI label, and keep the answer key in column D for the review sample only. Type the allowed categories in G2:G5 so that formulas can check against them. Then select C2:C13 and use the Fill option with a custom prompt. A prompt that names the exact labels and forbids anything else works better than a vague request, because the model has no other way to know your taxonomy:


Categorize each customer comment in column B as exactly one of these labels:
Billing, Shipping, Product quality, Account access.
Billing = charges, prices, invoices, refunds.
Shipping = delivery time, tracking, damaged or missing packages.
Product quality = defects, wear, materials.
Account access = login, passwords, two-factor codes, locked accounts.
Return only the label text, with this exact spelling and capitalization.

If you prefer to see the instruction in the cell, write the same logic as an AI function in C2 and fill it down, then select the cells and click Generate and Insert:


=AI("Categorize this customer comment as exactly one of: Billing, Shipping, Product quality, Account access. Billing = charges, prices, invoices, refunds. Shipping = delivery time, tracking, damaged or missing packages. Return only the label.", B2)

The definitions in the prompt carry most of the accuracy. Comment 109 mentions a returned jacket, which a model could file under Shipping or Product quality, but the definition puts refunds under Billing. Comment 110 mentions a missing item and a crushed box, which could look like Product quality; the definition puts damaged or missing packages under Shipping. Without those two lines, both rows are plausible errors.


··········


[[ADPLUS_300x250_1]]

EXPECTED RESULT AND HOW TO CHECK THE GEMINI LABELS.


With the answer key above, the correct result is three comments in each category: Billing 3, Shipping 3, Product quality 3 and Account access 3, for 12 rows in total. Those counts were computed in Python from the illustrative table; a fifth label or a count other than three in the AI column means at least one row needs review.


Three Sheets formulas cover the main checks. The first counts labels that are not on the allowed list in G2:G5, which catches invented categories and spelling variants such as "Billing issue" or "shipping". The second counts each allowed label so you can compare it with the answer key. The third measures agreement between the AI column and the answer key on the review sample.


=SUMPRODUCT(--ISNA(MATCH(C2:C13,$G$2:$G$5,0)))
=COUNTIF($C$2:$C$13,G2)
=SUMPRODUCT(--(C2:C13=D2:D13))/ROWS(C2:C13)

To see what the checks report, suppose a batch returns the label "Refund" for comment 109 and "Product quality" for comment 110, with every other row correct. This is a constructed test case to exercise the formulas, not an observed Gemini output. The off-list formula returns 1 (row 109), the counts show Billing 2, Shipping 2 and Product quality 4, and the agreement formula returns 0.8333, or 10 correct rows out of 12. The same checks in pandas on a CSV export give identical results and list the rows to fix:


import pandas as pd

df = pd.read_csv("feedback_labeled.csv")  # columns: ticket_id, comment, ai_label, expected
allowed = {"Billing", "Shipping", "Product quality", "Account access"}

off_list = df.loc[~df["ai_label"].isin(allowed), "ticket_id"].tolist()
mismatch = df.loc[df["ai_label"] != df["expected"], "ticket_id"].tolist()
agreement = (df["ai_label"] == df["expected"]).mean()

print("Off-list labels:", off_list)
print("Rows to review:", mismatch)
print(f"Agreement: {agreement:.4f}")
print(pd.crosstab(df["expected"], df["ai_label"]))

On the constructed test case the script prints off-list labels [109], rows to review [109, 110] and agreement 0.8333, and the cross-tabulation shows one Billing row filed as Refund and one Shipping row filed as Product quality. On larger samples the cross-tabulation shows which pairs of categories the model confuses, and therefore which definition in the prompt needs sharpening.


··········


REVIEW STEPS BEFORE THE LABELS REACH A PIVOT TABLE OR DASHBOARD.


Build the answer key on a sample before you run the full column. Twenty to fifty rows labeled by someone who knows the business are enough to see whether the prompt works; run the prompt on the sample, check agreement and the cross-tabulation, adjust the definitions, and only then fill the rest of the column. The sample size is a working choice, not a Google recommendation, so scale it to how much rides on the numbers.


Freeze the labels once they are reviewed. Because AI output is regenerated only when you click Refresh and Insert, a later refresh can change labels that were already checked. After review, copy the label column and paste values only into a new column that the pivot table reads, so the reported counts cannot shift. Google also records generated content as attributed to you in version history, which helps when someone asks where a number came from.


Watch for drift between batches. Labels produced in different batches may differ in spelling or in how borderline cases are handled, so rerun the off-list formula and the label counts after every batch. If a new type of comment appears that fits none of the four categories, add an explicit Other label to the prompt and to G2:G5 rather than letting the model force it into an existing category.


Keep humans in charge of decisions that depend on the labels. Google's help pages state that Gemini suggestions may be inaccurate or inappropriate and should not be relied on as medical, legal, financial or other professional advice. Category counts used for staffing, refunds or product recalls should come from a reviewed column, and individual escalations should be read by a person.


If the categorized column feeds a summary, the same discipline applies downstream: a pivot table built with Gemini in Google Sheets should be checked against COUNTIF totals, and a QUERY formula written with Gemini should be tested on rows whose result you already know. For raw exports with duplicates and inconsistent formats, cleaning the file first, as in the CSV cleanup workflow with ChatGPT, removes noise that would otherwise end up in the categories.


··········


⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁤

DATA HANDLING AND ADMIN SETTINGS FOR GEMINI IN SHEETS.


The AI function help page states that the function does not have access to your other files and cannot read the entire spreadsheet; it works on the prompt and the ranges you reference. Customer comments can contain names, order numbers and email addresses, so check your organization's policy and consider removing personal details before categorizing. The Help Center reminds enterprise users that feedback submitted on a generated cell should not contain personal, sensitive or confidential information.


Administrators control access through the Smart features for Google Workspace setting in the Admin console: when it is off, Fill with Gemini is hidden. The October 28, 2026 update says the feature is enabled by default for users who have Gemini in Sheets turned on. Cell-level web source citations, available in Sheets on the web only, matter mainly when Fill with Gemini looks up facts; a category label should depend only on the comment and your definitions. The older AI function overview on Data Studios covers the formula's general behavior in more depth.


··········


FILL WITH GEMINI FOR TEXT CATEGORIZATION: WHAT GOOGLE CONFIRMS AND WHAT YOU MUST CHECK.


Google confirms that Fill with Gemini is an entry point to the AI function, that it is available on Business Standard and Plus, Enterprise Standard and Plus, the AI Expanded Access and Google AI Pro for Education add-ons and the consumer Google AI Pro and Ultra plans, and that requests can cover up to 3,000 cells after the October 2026 update. The AI function page adds the 350-cell generation limit per selection, the text-only output, the ban on nested AI functions and the short-term and long-term usage limits.


What depends on your tenant is whether Smart features for Google Workspace is enabled, which language your account uses, and how much of the per-user usage allowance remains. Google does not publish exact per-user generation quotas on the help pages verified on November 16, 2026, and it does not publish accuracy figures for categorization tasks, so the only reliable accuracy number is the one you measure on your own answer key.


For a categorization column that people will report from, the method that holds up is a prompt with explicit label definitions, an off-list check, per-label counts compared with a reviewed sample, a cross-tabulation to find confused categories, and a frozen values-only copy of the final labels.


··········


FOLLOW US FOR MORE.


·····


DATA STUDIOS


·····


datastudios.org


bottom of page