Part of the free Module 13: Excel Formulas with AI · Lesson 4 of 9 · Full Excel course
Updated on 5 September 2026 · Microsoft 365 only, with a Microsoft 365 Copilot licence. First released to Microsoft 365 Insiders (Beta Channel) in August 2025 and rolling out since; check whether it has reached your channel. Not available in Excel 2024, 2021, 2019 or 2016.
The COPILOT function in Excel is a worksheet function that sends a natural-language prompt, plus any cell ranges you pass as context, to Microsoft 365 Copilot and returns the answer in the cell. When there are several results, the answer spills into neighbouring cells like any dynamic array. It recalculates when the inputs change, so it behaves like a formula rather than a one-off chat.
What the COPILOT function is and who can use it
COPILOT is different from the Copilot pane. The pane is a conversation on the side of the screen; the function lives inside the grid. You type =COPILOT(...), reference cells as context, and the model reads those cells and writes its answer back as text. Because it is a formula, you can copy it down a column, wrap it in other functions and build reports from its output.
Availability is licence-gated. You need a Microsoft 365 subscription with a Microsoft 365 Copilot licence (or a Personal or Family plan that includes Copilot), a current build of Excel for Windows or Mac, and the function must have rolled out to your update channel. It appeared first in the Beta Channel for Insiders in August 2025. If =COPILOT returns #NAME?, the function has not reached your build or licence yet. It does not exist in perpetual versions such as Excel 2024 or 2021.
COPILOT function syntax and arguments
The function takes prompt text and context in alternating pairs. You can repeat the pairs as many times as you need.
=COPILOT(prompt_part1, [context1], [prompt_part2], [context2], ...)
| Argument | Meaning | Example |
|---|---|---|
prompt_part1 |
Required. Text telling Copilot what to do. | "Classify this review as Positive, Neutral or Negative" |
context1 |
Optional. A cell, range or value Copilot should read. | A2 or A2:A20 |
prompt_part2 |
Optional. More instructions, often about output format. | "Return one word per row" |
context2 |
Optional. A second range, for example a list of allowed categories. | $F$2:$F$5 |
The result is always text (or a spilled array of text). If you need a number, wrap the call in VALUE or NUMBERVALUE and expect occasional failures, because the model may add words.
What the COPILOT function is good for
Use it for language tasks that are tedious by hand and awkward with classic text functions. The four patterns below cover most real work. Outputs are shown as typical results; wording can vary between runs.
Classify text into fixed categories
=COPILOT("Classify this support ticket as Billing, Technical or Account. Reply with one word only.", B2)
| B: Ticket text | Typical result |
|---|---|
| I was charged twice this month | Billing |
| The app crashes when I open a PDF | Technical |
| How do I change my email address? | Account |
| Invoice 4471 shows the wrong VAT | Billing |
Summarise a block of text
=COPILOT("Summarise these customer comments in one sentence of no more than 25 words.", B2:B9)
Point the context at the whole column of comments and you get a single sentence you can drop into a report header.
Extract a value from messy text
=COPILOT("Extract the product name mentioned in this sentence. If none, return blank.", B2)
| B: Sentence | Typical result |
|---|---|
| Loved the Aurora headphones, battery is great | Aurora headphones |
| Delivery took three weeks | (blank) |
| The Nimbus kettle leaks from the lid | Nimbus kettle |
Generate a list
=COPILOT("List the 12 months of the year in order, one per row")
This spills 12 cells downwards. For anything fixed like this, SEQUENCE with TEXT is faster and repeatable, but the pattern shows how spilling works: generate country lists, standard categories or draft labels, then paste as values.
What the COPILOT function is not for
Treat COPILOT as a language tool, not a calculator. Keep these limits in mind.
- Numeric work. Do not ask it to sum, average or forecast. Use
SUMIFS,AVERAGEIFSor a pivot table, which are exact and auditable. - Reproducibility. The same prompt can return slightly different wording on recalculation. Anything that must be audited or reconciled should not depend on it.
- Large ranges. Usage is rate-limited. At launch Microsoft documented limits of 100 calls per 10 minutes and 300 per hour per user. A formula copied down 2,000 rows will hit the limit; process in batches or pass the whole column as one context argument.
- External data. The function does not browse the web or open other files. It only sees the text you pass to it.
- Confidential data. Cell contents are sent to the Copilot service under your tenant’s Microsoft 365 terms. Follow your organisation’s data policy; see the privacy chapter later in this course.
- Recalculation cost. Because it re-runs when inputs change, editing a source cell triggers new calls. Switch to manual calculation while you build, then paste results as values.
Combining COPILOT with other functions
The output is ordinary text, so the rest of Excel can work on it. Wrap it in IFERROR so a rate-limit or licence error does not break a report:
=IFERROR(COPILOT("Classify as Complaint, Praise or Question. One word.", B2), "Not classified")
Count the categories it produced with COUNTIF, or feed the spilled column into UNIQUE and FILTER to build a summary. To lock the answers, copy the result column and use Paste Special > Values; the classification then stops recalculating and stops costing calls.
Worked example: classify customer feedback and count complaints
A support team receives free-text comments and wants a quick count of complaints. Column A holds an ID and column B the comment.
| A: ID | B: Comment | C: Label (spilled) |
|---|---|---|
| 101 | Order arrived late and the box was crushed | Complaint |
| 102 | Great service, thank you | Praise |
| 103 | Can I change the delivery address after ordering? | Question |
| 104 | The refund still has not arrived | Complaint |
| 105 | Do you ship to Ireland? | Question |
- In C2 enter one formula that spills five labels:
=COPILOT("Classify each comment as Complaint, Praise or Question. Return exactly one word per row, in the same order.", B2:B6) - Wait for the cells to fill. While Copilot is working the cell shows a busy state; do not edit B2:B6 until it finishes.
- In E2 count complaints:
=COUNTIF(C2#,"Complaint"). The#follows the spill range whatever its size. Result: 2. - Check the five labels by eye. If any is wrong, tighten the prompt (for example, define Complaint as “something went wrong for the customer”) and let it recalculate.
- When satisfied, copy C2:C6 and paste as values so the labels stop changing.
COPILOT function vs Copilot pane vs ChatGPT
| Task: label 200 comments | COPILOT function | Copilot pane | ChatGPT |
|---|---|---|---|
| Where the work happens | In the cell, recalculates | Side pane, inserts a column once | Browser; you paste text in and results out |
| Sees the workbook | Only the ranges you pass | The active table or sheet | Only what you paste or upload |
| Repeatable | Re-runs on change; wording may vary | Manual repeat | Manual repeat |
| Licence | Microsoft 365 Copilot | Microsoft 365 Copilot | Free or paid OpenAI account |
| Best for | Classifying and extracting inside a live sheet | Formula columns, pivots, charts | Writing and explaining formulas, no company data |
Tips and common mistakes
- Constrain the output. Say “one word only”, “in the same order” or “return blank if not found”. Loose prompts produce sentences you cannot count.
- Pass the whole range once rather than copying the formula down 500 rows. One call that spills uses one request instead of 500.
- Use manual calculation while building. Formulas > Calculation Options > Manual stops every keystroke from re-sending prompts.
- Do not mix it with money. Anything that ends up in an invoice, a payroll or a board pack should be calculated with exact functions and, at most, labelled by COPILOT.
- Paste as values when done. A finished report should not call Copilot every time someone opens it.
- Give category lists as context. Put allowed labels in a range and pass it as
context2; the model then sticks to your spelling. - Expect variation. If two runs disagree on an edge case, the comment is genuinely ambiguous. Decide the rule yourself and add it to the prompt.
Errors and how to fix them
| Symptom | Likely cause | Fix |
|---|---|---|
#NAME? |
Function not available in your build, channel or licence | Update Office, confirm a Copilot licence, or wait for the roll-out; use the Copilot pane meanwhile |
| Cell stays busy or shows a loading state | Copilot service is still responding, or many calls are queued | Wait; reduce the number of formulas by passing a range as one context |
#VALUE! |
Prompt is not text, or an argument is out of order | Put prompt text in quotes; keep prompt and context pairs alternating |
| A message about usage limits | Too many calls in 10 minutes or in the hour | Pause, then batch the work; paste finished results as values |
#SPILL! |
Cells below the formula are not empty | Clear the cells the result needs, or move the formula |
| Results change after every edit | Normal recalculation re-running the prompt | Switch to manual calculation or paste as values |
Practice exercise
- Type eight product reviews in B2:B9. Write one COPILOT formula in C2 that spills a sentiment label for each (Positive, Neutral, Negative).
- Add
=COUNTIF(C2#,"Negative")in E2 and confirm the count matches what you see. - Put the three allowed labels in F2:F4 and rewrite the prompt so it passes that range as a second context. Does the output spelling become more consistent?
- Ask COPILOT to extract the city name from six address strings. Note any row where it guesses.
- Switch to manual calculation, change one review, press F9, and watch which cells recalculate.
Key takeaways
- COPILOT is a licence-gated Microsoft 365 function that returns AI text answers in cells and can spill several results.
- It excels at classifying, summarising and extracting text; it is not for calculations or anything that must be reproducible.
- Constrain the output format in the prompt and pass allowed categories as context.
- Respect rate limits by passing ranges rather than copying formulas down, and paste results as values when finished.
- Wrap it in IFERROR and use COUNTIF, UNIQUE and FILTER on its output to build reports.
Related lessons
- Excel Formulas with AI: course home
- Copilot in Excel: formula suggestions, column formulas and Analyze Data
- Verifying AI formulas: test cases, edge cases and hallucinations
- AI and company data in Excel: privacy, security and best practices
- IFERROR function and COUNTIF function in the formulas library
- Microsoft Support: Get started with Copilot in Excel
Frequently asked questions
What does the COPILOT function do in Excel?
It sends a text prompt and optional cell ranges to Microsoft 365 Copilot and writes the reply into the cell. Use it to classify, summarise, extract or generate text directly in the grid. Results can spill into several cells and recalculate when the referenced cells change.
Do I need a licence for the COPILOT function?
Yes. It requires a Microsoft 365 subscription with a Microsoft 365 Copilot licence, or a Personal or Family plan that includes Copilot, on a current build of Excel for Windows or Mac. It is not part of Excel 2024, 2021, 2019 or 2016 and cannot be added to them.
Can the COPILOT function do maths?
It can attempt arithmetic, but you should not rely on it. Language models are not calculators and the answer may vary between runs. Use SUM, SUMIFS, AVERAGEIFS or a pivot table for numbers and reserve COPILOT for text tasks such as labelling and summarising.
Why does =COPILOT return #NAME? in my Excel?
Excel does not recognise the function, which means it has not reached your version, update channel or licence. Check that you are on Microsoft 365 with a Copilot licence, update Office, and confirm the roll-out has reached your channel. Perpetual versions never get it.
Does the COPILOT function send my data to the internet?
The prompt and the referenced cells are sent to the Copilot service in Microsoft’s cloud under your tenant’s Microsoft 365 terms. It does not browse the web or read other files. Follow your organisation’s data policy before pointing it at confidential columns.
Want the finished version? Ready-made Excel dashboards, trackers and VBA systems are available at NextGenTemplates.com.