Blog Post

Excel Blog
5 MIN READ

Python in Excel – Available Now

msexcel's avatar
msexcel
Icon for Microsoft rankMicrosoft
Sep 16, 2024

Combining the Power of Python and the Flexibility of Excel

(10/14/24) UPDATE: Python in Excel is now available to Enterprise and Business users running the Current Channel on Windows, starting with Version 2407 (Build 17830.20128), and Monthly Enterprise Channel on Windows, starting with Version 2408 (Build 17928.20216).

 

Python in Excel is now generally available for Windows users of Microsoft 365 Business and Enterprise. Last August, in partnership with Anaconda, we introduced an exciting new addition to Excel by integrating Python, making it possible to seamlessly combine Python and Excel analytics within the same workbook, no setup required. Since then, we’ve brought the power of popular Python analytics libraries such as pandas, Matplotlib, and NLTK to countless Excel users.

 

Watch to learn more about Python in Excel:

 

“Seamless integration of Python data structures like pandas data frames and NumPy arrays in Excel is a total game changer. This expanded access to Python will create exciting new opportunities for innovation as well as making it even easier for business analysts and data scientists to collaborate.”

Wes McKinney, creator of pandas 

 

With Python in Excel, users can harness advanced analytics for visualizations, data cleaning, machine learning, predictive analytics, and now, even more! Here are a few examples of what is possible, inspired by what our community of analysts is building within the Insiders Audience and internally at Microsoft.

 

Leverage predictive analytics

Advanced modeling capabilities in Python offer detailed and flexible optimization analysis – such as Monte Carlo simulations. These capabilities allow users to handle complex scenarios, providing deeper insights into their data.

 

 Apply Monte Carlo simulations to project possible expenses.

 

 

Visualize network connections

NetworkX is a powerful tool for creating and analyzing complex networks, offering flexibility to model and visualize relationships between nodes effectively.

 

Use network models to view changes over time.

 

"Using Python in Excel has significantly streamlined my workflow… It has made complex data handling and visualization straightforward and efficient. The feature requires no setup, saving me significant time. The integration has made advanced data manipulation more accessible."

Jack McCullogh, Principal Partner PM – Microsoft Business and Industry Copilots

 

Parse natural language

The NLTK and word cloud libraries in Python provide robust tools for text analysis and visualization. NLTK excels in natural language processing tasks, while word cloud generates visually engaging representations of textual data.

 

 Extract and examine text to derive insights.

 

 "Progressive analysts, who rely on data analytics for insights, could benefit by what we’ve seen with the latest advancements like Python in Excel. Excel’s integration with Copilot brings AI capabilities closer to where data currently resides—within our workbooks. Bringing all of this together with the ability to prompt in plain language could help analysts to leverage state-of-the-art analytics, such as advanced visualizations, allowing them to use just Excel and excel at their craft.". 

Pawan Divikarla, Business Leader, Progressive Insurance   

 

Continuous Improvements

 

Modern editing

A great Python experience requires modern editing. This includes new features like syntax highlighting, code completion, and aid when referencing data with the xl() function - all of these have been added directly to the Formula Bar. Furthermore, we recently announced the Python Editor, a new surface that is a great companion for authoring code and leverages many of the same experiences found in Visual Studio Code.

 

Manage all your Python formulas from a single location.

 

Copilot in Excel with Python

Today we announced the public preview of Copilot in Excel with Python, which is designed to leverage AI to unlock the power of Python in Excel to a broader set of users. With Copilot, you can use natural language to describe the analysis you want to perform, and it will automatically generate, explain, and insert Python code into your Excel spreadsheet.

 

Dive deeper into your data with Copilot in Excel with Python, all without writing a single line of code.

 

“With a two sentence Copilot prompt, I was tickled to see Copilot in Excel write Python using RandomForestRegressor from sklearn module, which basically opened the world of machine learning to me. With working Python code in hand, I believe I can tune the parameters to achieve the desire output.  When I had to learn Python before I could even start, I didn't start.”

Mark Hodge, Microsoft 365 Global Blackbelt

 

Security is our priority

Python code used by Excel runs on the Microsoft Cloud with enterprise-level security as a compliant Microsoft 365 connected experience, just like OneDrive. 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 by preventing 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. The containers stay online as long as the workbook is open or until a timeout occurs. Your data does not persist in the Microsoft Cloud.

 

Learn more about our Data Security

 

Empowering Excel users

We believe there is a significant opportunity for anyone using Excel for analysis to greatly enhance their work with Python. Alongside incorporating numerous examples, tutorials, and tips into Excel, there are courses for Python in Excel on LinkedIn Learning. A new series, announced today, will be available for free for 30 days! After that time, it will be available to LinkedIn Premium or LinkedIn Learning subscribers.

 

Thank you for your feedback during Preview

We appreciate everyone who tested the feature, provided early feedback, identified issues, and created content during the initial rollout within the Insiders audience. Your assistance and feedback were crucial in getting us to our current version.  We are inspired by what the community has built using Python in Excel already and are excited for even more users to now have access to this powerful feature.

 

We want your feedback!

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.

 

Availability

Python in Excel is now generally available for Windows users of Microsoft 365 Business and Enterprise. With qualifying Microsoft 365 subscriptions, you can calculate Python formulas with standard compute and automatic recalculation mode. For faster calculations with premium compute and access to manual or partial recalculation modes, you must purchase the Python in Excel add-on license or request the license from your administrator. 

To learn more about specific details on versions and channels, please see Python in Excel availability.

 

Other resources:

Introduction to Python in Excel

Getting started with Python in Excel

Learn more about Anaconda

Learn Python in Excel with LinkedIn Learning

 

 

Updated Oct 14, 2024
Version 5.0