Since its inception, Microsoft Excel has changed how people organize, analyze, and visualize their data, providing a basis for decision-making for the millions of people who use it each day. Today we’re announcing a significant evolution in the analytical capabilities available within Excel by releasing a Public Preview of Python in Excel. Python in Excel makes it possible to natively combine Python and Excel analytics within the same workbook - with no setup required. With Python in Excel, you can type Python directly into a cell, the Python calculations run in the Microsoft Cloud, and your results are returned to the worksheet, including plots and visualizations.
Seamlessly aggregate and visualize your data with Python in Excel.
Python in Excel is rolling out to Public Preview for those in the Microsoft 365 Insiders program, using the Beta Channel in Excel for Windows.
Watch Python in Excel in action and learn more below:
Every day millions of users around the world rely on familiar Excel tools such as formulas, charts, and PivotTables to analyze and understand their data. Starting today, Python in Excel will also be natively integrated directly into the Excel grid. To get started simply use the new PY function which allows you to input Python code directly into Excel cells.
Create DataFrames with a few simple clicks.
Excel users now have access to powerful analytics via Python for visualizations, cleaning data, machine learning, predictive analytics, and more. Users can now create end to end solutions that seamlessly combine Excel and Python – all within Excel. Using Excel’s built-in connectors and Power Query, users can easily bring external data into Python in Excel workflows. Python in Excel is compatible with the tools users already know and love, such as formulas, PivotTables, and Excel charts.
Here are some examples of the types of analysis that are now possible with Python in Excel:
Tap into the potential of well-known Python charting libraries like Matplotlib and seaborn to create a wide variety of charts, spanning from conventional bar graphs and line plots to specialized visualizations such as heatmaps, violin plots, and swarm plots.
Pair plot using Seaborn.
Machine Learning, Predictive Analytics, and Forecasting
Leverage the capabilities of Python libraries like scikit-learn and statsmodels to apply popular machine learning, predictive analytics, and forecasting techniques such as regression analysis, time series modeling, and more.
Machine Learning model predicting the weather using Python and Excel LAMBDA.
Make efficient use of advanced data cleaning techniques such as locating missing values, standardizing formats, removing duplicates, and employing techniques like regular expressions for pattern-based transformations.
Date extraction using regular expressions.
2. Python in Excel exposes the best of Python analytics via Anaconda.
Anaconda is a leading enterprise Python repository used by tens of millions of data practitioners worldwide. Python in Excel leverages Anaconda Distribution for Python running in Azure, which includes the most popular Python libraries (e.g. pandas, Matplotlib, scikit-learn, etc.), and is securely built, tested, and supported by Anaconda. Python provided by Anaconda supports a wide array of analytics with Python in Excel.
"I am thrilled to announce the integration of Anaconda Distribution for Python into Microsoft Excel – a major breakthrough that will transform the workflow of millions of Excel users around the world.” said Anaconda CEO and co-founder Peter Wang.
3. Python in Excel runs securely on the Microsoft Cloud, with no setuprequired.
Python code used by Excel runs on the Microsoft Cloud with enterprise-level security as a compliant Microsoft 365 connected experience. The Python code runs in its own hypervisor isolated container using Azure Container Instances and secure, source-built packages from Anaconda through a secure software supply chain. Python in Excel keeps your data private bypreventing the Python code from knowing who you are, and opening workbooks from the internet in further isolation within their own separate containers. Data from your workbooks can only be sent via the built-in xl() Python function, and the output of the Python code can only be returned as the result of the =PY() Excel function.
Learn more about our Data Security
4. Python in Excel is built for teams.
Users can share Python in Excel workbooks with confidence. Teammates can seamlessly interact with and refresh Python in Excel based analytics without needing to worry about installing additional tools, Python runtimes, or managing libraries and dependencies. Users can share workbooks using their favorite collaboration tools such as Microsoft Teams and Microsoft Outlook and work together seamlessly via comments, @ mentions, and co-authoring with colleagues as they normally would in Excel. Sensitivity labels applied to your workbooks containing Python will keep them compliant with your organization's information protection policies.
5. Python in Excel reflects Microsoft’s deep commitment to Python.
Python in Excel was crafted thanks to a close partnership across multiple teams at Microsoft, including Microsoft Excel, Microsoft Developer Division, Microsoft Security, Microsoft Azure, and Microsoft Research. This project reflects the importance of Python to Microsoft and our commitment to collaborate with the Python community as well as making Python better and more accessible for everyone.
Guido van Rossum, Python’s creator, emeritus BDFL and now Microsoft Distinguished Engineer, has helped define the architecture for Python in Excel. Here’s his reaction to the Public Preview:
"I’m excited that this excellent, tight integration of Python and Excel is now seeing the light of day. I expect that both communities will find interesting new uses in this collaboration, amplifying each partner's abilities. When I joined Microsoft three years ago, I would not have dreamed this would be possible. The Excel team excels!"
McGraw Hill - “McGraw Hill’s ethos is education for all, and our partnership with Microsoft has helped improve student access to Excel tools, building career readiness. Python is one of the most in-demand skills we’re hearing from colleges and universities, and we’re thrilled that Python in Excel will provide educators and students with a powerful new gateway to move faster with analytics, enable greater collaboration and learning, and ultimately bridge students to even brighter futures.” -Rebecca Olson,Sr. Portfolio Director
McKinney - “The ability to run Python in Excel simplifies McKinney's reporting workflows. We used to manipulate data structures, filter, and aggregate data in a Jupyter Notebook, and build visuals in Excel. Now we can manage the entire workflow in Excel. This is going to make Excel that much more powerful and make Python more accessible across the organization. Python support is the most exciting update for Excel in my career!” -Greg Barnes,Executive Director of Data and Analytics
KPMG -“KPMG and Microsoft are making significant investments to deliver advanced cloud-based tax technologies.At KPMG, we’re excited about the impact Python in Excel will have for our Tax clients. Backed by the data and security promises enabled by the Microsoft cloud, Python has the potential to enhance the Excel experience for advanced analytics while providing companies with transparency,simplicity and deeper insights into their financials.”– Tejas Varia, Principal, Tax Data & Analytics
Python in Excel is gradually rolling out to users running Beta Channel on Windows. This feature will roll out to Excel for Windows first, starting with build 16.0.16818.20000, and then to the other platforms at a later date.
To use Python in Excel, join the Microsoft 365 Insider Program. Choose the Beta Channel Insider level to get the latest builds of the Excel application.
Don’t have it yet? It’s probably us, not you. Features are released over time to ensure things are working smoothly. We highlight features that you may not have because they’re slowly releasing to larger numbers of Insiders. Sometimes we remove elements for further improvement based on your feedback. Though this is rare, we also reserve the option to pull a feature entirely out of the product even if you, as an Insider, have had the opportunity to try it.
While in Preview, Python in Excel will be included with your Microsoft 365 subscription. After the Preview, some functionality will be restricted without a paid license. More details will be available before General Availability.
Excel and Python users can give feedback directly within the application (go to Help > Feedback), suggest improvements on our Feedback portal, or engage with our team on GitHub.
As mentioned above, we’re releasing Python in Excel as a Public Preview to the Insiders Beta Channel so you should expect new capabilities to light up soon. Stay tuned for updates on the following areas: improved editing experiences (such as autocomplete and syntax highlighting), default Reprs, enhanced error behaviors, help and documentation, and more. In addition, to prevent abuse, the system currently has some data size and compute limitations that we will closely monitor and adjust.
Introduction to Python in Excel
Getting started with Python in Excel