
Sentiment analysis in Google Sheets is now possible without add-ons or code if your account has the AI function. You write a short prompt, point it at a customer comment, and the cell returns a label such as positive, negative or neutral. This guide shows how to set it up, which prompts work, how to label a whole column and what the feature cannot do. The comments in the examples are made up.
What you need first
According to Google's help page for the AI function, it requires an eligible Google Workspace or Google AI plan, or participation in the Google Workspace Experiments program. If you see "AI function not available", your plan, your admin settings or your language setting may be the reason. Check the official help page for the current list, because availability can change.

The basic sentiment formula
The syntax is AI("prompt", [range]). You can also write Gemini(), which does the same. Google's own examples include a sentiment prompt, so the pattern is supported:
=AI("Classify the body of the email as either positive, negative, or neutral.", D2)
For a column of customer comments in B, a prompt in your own words works the same way:
=AI("Classify the sentiment of this comment as positive, negative or neutral. Answer with one word only.", B2)
Generate the result
After you type the formula, select the cell and click Generate and Insert. Sheets does not run the prompt until you do. To rerun it, click Refresh and Insert.

Label the whole column
Write the formula in the first row, then fill it down the same way you copy any formula. Select all the cells with the AI function and click Generate. Google notes that only the first 350 selected cells are generated at a time, so for a longer list, wait and select the next group.
You can also add an AI column to a table. Click Insert AI column right at the top right of the last column in the table, then enter your prompt in the first row and autofill.

Prompts that give cleaner labels
- Limit the answers. Say "Answer with one word only" and list the allowed labels. This makes the column easy to count.
- Define the labels. For example: "Negative means the customer asks for a refund or complains."
- Ask for a reason in a second column. Use a separate prompt such as "Explain the sentiment in under 10 words" so the label stays clean.
- Give context. Mention the business, for example "These are reviews of a pet sitting service."
Count the results
Once the labels are in a column, normal formulas take over. To count negative comments:
=COUNTIF(C2:C100, "negative")
Our guide to the COUNTIF function in Google Sheets shows more ways to count, and UNIQUE lists the labels the model used.

What the AI function cannot do
These limits come from Google's help page:
- Responses are limited to text.
- The function does not see your whole spreadsheet or your Drive files. Pass the data in the range argument.
- You cannot undo or redo a generated result. Regenerate it instead.
- Embedded AI functions are not supported. Wrapping AI() inside IF() is the example Google gives, so keep the label in its own cell and test that cell instead.
- There are short term and long term generation limits. If you hit the long term limit, wait 24 hours.
Check the results yourself
A language model can mislabel sarcasm, mixed comments or short text. Read a sample of the labels before you use the counts in a report. Google also says Gemini features may suggest inaccurate information. If the data is private, review your organization's rules before you put customer text in a sheet that uses AI.
For more on AI inside Sheets, see Google Sheets AI formulas.
Questions and answers
Is there a built-in SENTIMENT function?
No. You use the AI function with a prompt that asks for the sentiment.
Does it work in Excel?
This feature is specific to Google Sheets. In Excel you would use a different tool, and we do not make claims about Excel features we have not verified.
Can it label comments in Arabic or other languages?
Google lists supported languages for Gemini in Workspace. Check that list for your language before you rely on it.
Why does a result change when I refresh?
The model generates a new answer each time. Strict prompts with a fixed list of labels reduce this.
Summary
Use AI("prompt", cell) with a strict one-word prompt, generate the column in groups, count the labels with COUNTIF, and always check a sample by hand.
