Applies To
Excel for Microsoft 365 Excel for Microsoft 365 for Mac Excel for the web Excel Web App Excel for iPhone

This article describes the formula syntax and usage of the COPILOT function in Microsoft Excel. 

Notes: This feature requires a license for premium Copilot features. Learn more: 

Important: This function is currently in Beta and only available to users on the Beta Channel, which is available through the Microsoft 365 Insider program

Description

The COPILOT function allows users to leverage artificial intelligence by providing a prompt and references from the grid to generate responses based on an AI language model. 

Syntax

=COPILOT(prompt_part1, [context1], [prompt_part2], [context2], ...)

The COPILOT function syntax has the following arguments:

  • Prompt_part    Required. Text that describes the task or question for the AI model. Each prompt_part in sequence with the context to make a single prompt

  • Context    Optional. A reference from the grid that provides context or data for the AI model. This can be a single cell or a range

Tips: 

  • The prompt sent to the AI model is constructed from all of the prompt_part and context arguments

  • For example, for this formula:

  • =COPILOT("Classify", B1:B10, "into one of the following categories ", A1:A4)

  • This is sent to the AI model:

  • "Classify [the values from B1:B10] into the following categories [the values from A1:A4]"

Using the COPILOT function

The COPILOT function call an AI model hosted on Azure directly from a cell formula. It returns a response based on your prompt and any referenced data, enabling dynamic, intelligent outputs right in the grid.

When to use the COPILOT function

The COPILOT function is designed for semantic, generative, and exploratory tasks. It is best suited for scenarios where deterministic accuracy is not required, and where natural language understanding can provide value. Recommended use cases include:

  • Summarizing text: Condense long strings or cell ranges into concise summaries. For example, =COPILOT("Summarize this feedback", A2:A20)

  • Generating sample data: Create placeholder or example data for prototyping or demos. For example, =COPILOT("Five ice cream flavors")

  • Classifying or tagging content: Assign categories or labels to text entries. For example, =COPILOT("Classify sentiment", B2:B100)

  • Generate text: Create simple text content. For example, =COPILOT("Create a description for this product based on its specs", B2:B8)

When NOT to use the COPILOT function

COPILOT uses AI and can give incorrect responses.

To ensure reliability and to use it responsibly, avoid using COPILOT for:

  • Numerical calculations: Use native Excel formulas (e.g., SUM, AVERAGE, IF) for any task requiring accuracy or reproducibility.

  • Responses that require context other than the ranges provided: The COPILOT function only has access to the prompt and context provided to or referenced by the function. It does not have access to other data from your workbook, data from other files or enterprise information.

  • Lookups based on data in your workbook: Use XLOOKUP to look up data based on a table or range.

  • Tasks with legal, regulatory or compliance implications: Avoid using AI-generated outputs for financial reporting, legal documents, or other high-stakes scenarios.

  • Recent or real-time data: The function is non-deterministic and may return different results on recalculation. Currently, the model's knowledge is limited to information before June 2024.

COPILOT can return multiple results

Based on the context you give it, the COPILOT function can return multiple results as a Dynamic Array that spills across the grid.

Using COPILOT to return multiple values based on context from the grid. In this example, the output is whether each review is positive or negative and the topics from the review

This reduces the number of COPILOT calculations being made and allows the model to give useful outputs based on many inputs.

Usage limits

  • The COPILOT function is only available to users with a Copilot subscription

  • You can calculate up to 100 COPILOT functions every 10 minutes

  • The COPILOT function cannot calculate in workbooks labelled Confidential or Highly Confidential

Common errors

Error text

Error type

Description

Short-Term Limit Exceeded

#CONNECT

You have exceeded the limit of 100 Copilot function calculations within 10 minutes. Wait 10 minutes and try again.

Prompt Error

#VALUE

Your prompt cannot be evaluated. Edit your prompt and try again.

Prompt Too Large

#VALUE

Your prompt (including context) is too large. Please reduce the size of your prompt or context.

License Not Found

#BLOCKED

Your Copilot license could not be found. If you have a Copilot license try logging in again.

Server Timeout

#CONNECT

No response from the server. This may be resolved by simplifying your prompt, or there may be an issue with the server.

Confidential Workbook

#BLOCKED

The COPILOT function cannot calculate in workbooks labelled Confidential or Highly Confidential

​​​​​​

Notes: 

  • The COPILOT function requires an active internet connection to access the AI models, which are hosted on Azure.

  • The COPILOT function only has access to data provided through the context arguments. It does not have access to:

    • Other data from the workbook

    • Enterprise data

    • Information from the internet

  • Currently, the COPILOT function uses gpt-4.1-mini (2025-04-14). 

  • The COPILOT function's model will evolve and improve in the future and formula results may change over time, even with the same arguments. Only use the COPILOT function where this is acceptable. If you don't want results to recalculate, consider converting them into values with Copy, Paste Values (select values, Ctrl + C, Ctrl + Shift + V).

  • Your prompts and data supplied as context will not be used to train AI models.

  • For more information on Copilot in Excel, see Frequently asked questions about Copilot in Excel

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.