Blog Post

Excel Blog
3 MIN READ

Introducing Copilot support for Python in Excel: Advanced Data Analysis Using Natural Language

DavidM's avatar
DavidM
Icon for Microsoft rankMicrosoft
Sep 21, 2023

Sept. 16, 2024 Update: Please check out our more recent blog for updated information

 

We recently announced Python in Excel, bringing one of the most powerful programming languages for data analysis to your spreadsheets. We’ve heard your excitement about leveraging AI with Python in Excel, and today we are thrilled to share how we are combining two of the most exciting new features in Excel so you can create powerful analytics with unprecedent ease with Copilot support for Python in Excel.  

 

Python code generation with Copilot in Excel 

 

In addition to helping you write formulas, format your data, and do data analysis, Copilot in Excel will help you analyze and explore your data in a new way: writing Python code. Just use everyday language to describe what you want to do with your data, and Copilot will generate and insert working Python code in the Excel grid for you.  

 

Watch Copilot and Python in Excel in action: 

Video overview of Copilot leveraging Python in Excel 

 

What can Copilot do with Python in Excel? 

Whether you are new to Python or an experienced user, Copilot helps you achieve more with your data in Excel by accessing advanced analytics. You can use Copilot as a learning tool, to unlock productivity, and as creative inspiration. Here are some of the benefits of using Copilot and Python in Excel: 

 

  • Use natural language for data analysis with Python.  Simply describe the analysis you want to do, and Copilot will generate and insert Python code for you. For example, you can type “Forecast sales for the next 4 quarters" and Copilot will produce a Python cell with the code and the forecast.

Forecasting model using Python in Excel, built with Copilot in Excel 

 

  • Access popular libraries and visualizations. You don't need to know Python to get started. Copilot leverages the power and flexibility of Python and its popular libraries, such as pandas, matplotlib, and scikit-learn to name a few. You can use Copilot to perform advanced analytics such as forecasting, clustering, optimization, causal models, statistical tests, classification, sampling, and more. You can also create a variety of charts that are not available in Excel alone, such as boxplots, network graphs, and pairplots.

Visualization using Python in Excel, built with Copilot in Excel 

 

  • Break down complex problems iteratively. Use Copilot as your sounding board and guide to perform your data analysis in an iterative fashion. Copilot remembers the context of your previous queries and results, allowing you to continue the conversation with additional analyses, follow-up questions, and ideas.

Data processing using Python in Excel, built with Copilot in Excel

 

Machine Learning model predicting the weather using Python in Excel, built with Copilot in Excel 

 

Building responsibly 

Microsoft 365 Copilot embraces our AI principles and Responsible AI Standard, and it follows our commitment to data security and privacy. Python in Excel runs in a secure container on the Microsoft Cloud with enterprise-level security as a compliant Microsoft 365 connected experience: Data security and Python in Excel - Microsoft Support. 

 

Availability 

Copilot support for Python in Excel will be available in preview later this year. 

 

To use Copilot and Python in Excel, you will need access to Python in Excel (How to enable the Python in Excel preview - Microsoft Support) and Microsoft 365 Copilot (Microsoft 365 Copilot – Microsoft Adoption). It will initially be available in Excel for Windows in English. 

 

Join the Python in Excel Reddit AMA on Sept 28th! 

Tune into our Ask Me Anything session on Reddit, r/excel, for questions, answers and more information on Python in Excel.

Updated Sep 16, 2024
Version 2.0
  • Hello Michael-Mertens ,

     

    Thanks for your interest in Python in Excel and Copilot!

     

    The functionality shown in the blog post is currently available to a very limited set of users as we make sure that the experience is up to the quality you expect for Excel. We expect to increase the availability in the coming weeks, but at this point can't provide a precise date for broad Insiders availability.

     

    Regarding your concern about only working with Excel Tables, this is one of the areas we are currently improving, and Copilot will also support Python cells for scenarios like the ones described here.

     

    Thanks again for your interest and patience!

     

    Best,

    David Monroy

  • I am excited about Copilot. I have python enabled in Excel, but I do not see any Copilot icon on my ribbon.

  • FALAK1976's avatar
    FALAK1976
    Copper Contributor

    Hi, this is great new and i am excited to start using python in excel. would be obliged if guided how to install python in excel.

    is it available on all versions of excel?

  • Michael-Mertens's avatar
    Michael-Mertens
    Copper Contributor

    Hi,

     

    this article is from September.
    Today I tried to test these functions, but copilot seems to be very limited. When the focus in Excel is not in a table, copilot says: "ask a question or make a request about data in a table". So if I don't have a table, it doesn't do anything. When I create a table, and put the focus into it, I can type something into the prompt. But whatever I try, especially regarding Python. copilot says "I'm not able to work on that".

    My environment is Excel version 2402, build 17318.20000 (Family License, Microsoft 365 Insider, Copilot Pro).

    So what is the status of the things shown in this blog post? Are they available for customers at all?

    Thanks & Regards
    Michael