COPILOT function
COPILOT asks an AI model to classify, summarize, or generate text from your cell data and returns the result, which may spill into neighboring cells. It needs the Copilot license and an internet connection.
Example
=COPILOT("Classify the sentiment as positive or negative",A1)
Expected result: n/a Not yet checked in desktop Excel
Syntax
COPILOT(prompt_part1, [context1], [prompt_part2], [context2], ...)
Arguments in [square brackets] are optional.
-
prompt_part1(required) - Your instruction text for the AI.
-
context1(optional) - A range or value for the AI to use.
-
prompt_part2(optional) - More instruction text.
-
context2(optional) - Another range or value.
Returns: AI-generated text or values, possibly spilling.
One COPILOT formula can fill more than one cell. When the result has several values, they spill into the cells below or to the right of the formula.
What Excel actually returns
Each formula below was run in desktop Excel. The result is exactly what the cell showed, errors included.
| Formula | Excel shows | Case |
|---|---|---|
=COPILOT() | #NAME? | No argument |
=COPILOT("Summarize",Data!A1:A5) | #NAME? | With prompt (name check only) |
The Data sheet these formulas read
A cell that starts with = holds that formula.
Watch out for
- Results can change between recalculations.
- Do not use it for exact numeric work; use normal formulas.
Where it works
- Excel
- COPILOT is only in Excel for Microsoft 365 and Excel for the web. Not in this local Excel build; a Microsoft 365 AI function that needs the Copilot licence and an internet connection.
- Google Sheets
- Done with a different function: `AI`. Sheets has its own AI function.
Part of Add-in and automation functions. Every result on this page was measured in desktop Excel, build 16.0.20527. Last updated .