Excel functions / AI
AI function · Excel
COPILOT function
COPILOT sends a prompt and optional cell data to an AI model from inside a formula. Use it for language work such as classifying or summarizing text. Use standard functions for arithmetic.
Syntax
=COPILOT(prompt_part1, [context1], [prompt_part2], [context2], ...)On Google Sheets: use AI. Both run prompts in a cell. Review prompts and outputs after moving.
Not on the Microsoft list we fetched. Added from Microsoft announcements. Requires a qualifying license.
Arguments
| Argument | Required | Meaning |
|---|---|---|
| prompt_part1 | Yes | The instruction in quotes. |
| context1 | No | A cell or range the model should read. |
| more parts | No | Alternate extra instructions and data. |
Worked example
| A | B | |
|---|---|---|
| 1 | Customer feedback | Sentiment |
| 2 | Delivery was late but support fixed it |
=COPILOT("Classify as Positive, Neutral or Negative. Answer with one word.",A2)Result: Varies. Example output: Neutral
The prompt fixes the allowed answers, and the cell supplies the text to classify.
Try it
AI output needs a live Microsoft account, and it can differ between runs.
Availability
| Platform | Status |
|---|---|
| Excel | Microsoft 365 with a qualifying Copilot license. Check your plan and region. |
| Google Sheets | Not available. See the AI function. |
Common mistakes
- Results can change between runs, so check them before they feed a report.
- Do not use it for financial totals, legal work or compliance decisions.
- Your data goes to a cloud AI service, so follow your company data policy.
Do it with AI
Paste this prompt into Copilot, Gemini or another assistant. Check the result on a small sample first.
Rewrite this prompt so it returns one allowed label and nothing else: =COPILOT("what does the customer think",A2)