Back to AI updates
MicrosoftNew features

Use Python when Editing with Copilot in Excel

If you build reports or analyse data in Excel, you can now ask Copilot to run genuine Python analysis, such as trend statistics, simulations or charts, without leaving the spreadsheet or knowing Python yourself. Handy for budget modelling or data cleanup tasks that used to need a specialist.

Read the original source 2 min read

What changed

Edit with Copilot in Excel can now write and run Python code directly against workbook data for advanced statistics, simulations and visualisations, with the results placed straight back into the workbook, using Excel's existing Python security and execution controls.

Why it matters to your work

If you build reports or analyse data in Excel, you can now ask Copilot to run genuine Python analysis, such as trend statistics, simulations or charts, without leaving the spreadsheet or knowing Python yourself. Handy for budget modelling or data cleanup tasks that used to need a specialist.

When this could help

Worth trying when you need analysis that goes beyond Excel's built-in functions — e.g. statistical modelling, Monte Carlo simulations, or custom visualisations — and you want Copilot to generate the Python for you.

Edit with Copilot in Excel can now run Python code against your workbook data for statistics, simulations, and advanced visualisations, with results output directly in the workbook. This brings Python's analytical power into Excel without requiring users to open a separate environment.

How to get started

  1. Open an Excel workbook with your data, open Edit with Copilot, and ask it to complete a task (e.g. 'summarise trends', 'clean this data', 'create a distribution chart using Python'). Review the output in Excel.

    Provider guidance ↗

Give AI a clearer brief

Situation
You have a dataset in Excel that needs analysis beyond standard formulas.
Consultant
Act as a data analyst.
Action
Using Python in Edit with Copilot, [describe the analysis, e.g. 'run a correlation matrix on columns A-F and visualise it as a heatmap']. [Fill in your real analysis task.]
Language
Results appear directly in the workbook — charts, tables, or cleaned data.
Ask
Review the Python code Copilot generates before relying on the output for decisions.

SCALA suggested prompt · Adapt the context and check the result.

Learn the SCALA method →

Build it into your routine

  1. Advanced reporting

    When your monthly report needs statistical analysis or custom charts that Excel formulas struggle with, ask Edit with Copilot to use Python instead of exporting to a separate tool.

What to check

  • No specific limitations, prerequisites, or licensing requirements are documented. The release notes state that 'existing security and execution controls continue to help manage how code runs' without describing those controls. Source ↗

Sources & provider guides

Official documentation checked 12 Oct 2026. SCALA prompts and workflows are suggestions, not claims of hands-on testing.

Source & availability

This is a summary of a published provider announcement, with practical context from SCALA’s feed.

Plan, region, workspace and rollout conditions may affect access in Australia. Check the original source for current availability.

learn.microsoft.com