Python in Excel is now available in Microsoft 365 – with two drawbacks

Microsoft 365 business customers can now use Python code directly in Excel, but currently only on Windows and with code execution in the cloud.

Save to Pocket listen Print view
Python symbol jumps out of the screen

(Image: erstellt mit Dall-E von iX-Redaktion)

3 min. read
Contents

Microsoft has announced the general availability of Python in Excel. This makes it possible to execute Python code directly in the spreadsheet and use frequently used libraries of the programming language for data processing.

Python in Excel is available for customers of the Business and Enterprise versions of Microsoft 365. However, the integration only works without restrictions under Windows at the start.

Microsoft presented the first public preview in August 2023. Python in Excel makes it possible to enter and execute code directly in the cells of a spreadsheet. The technical basis for the Python integration is the Anaconda distribution of the programming language.

In addition to the programming language itself, Python in Excel offers a connection to many Python libraries such as Pandas, scikit-learn, Matplotlib and the Natural Language Toolkit NLTK.

Python in Excel can create charts for text analysis in a Python sheet using the NLTK library.

(Image: Microsoft)

However, the distribution is in Azure, so the code always takes a detour via the Microsoft cloud in order to be executed there. For complex calculations, this approach may even be more performant than local execution, but for security and data protection reasons alone, some companies prefer to keep their code local.

Microsoft emphasizes that, for security reasons, Python in Excel runs in an isolated container on Azure that can only be accessed via the integrated functions (xl() for sending and =PY() for receiving data).

However, an alternative without the cloud is already in the starting blocks: At the beginning of August this year, Anaconda presented the Toolbox, which includes Anaconda Code, a tool that executes Python code locally. The Anaconda Toolbox is based on the PyScript project, which uses WebAssembly for integration into the browser. This allows the Python code to be executed locally in the browser-based Excel add-in.

In parallel to the general availability of Python in Excel, Microsoft has announced a public preview of Copilot in Excel with Python, which generates the appropriate Python code from analysis requirements in natural language.

The preview of Copilot in Excel with Python evaluates queries and creates code to visualize the data, among other things.

(Image: Microsoft)

Customers who use Excel on operating systems other than Windows – in the macOS, Android, iPhone, iPad or web version – can currently only use Python in Excel to a limited extent. According to the Microsoft support page, they can view prepared workbooks with Python, but recalculating cells with Python code results in an error message.

Python in Excel is included in the basic version of Microsoft 365 business licenses such as E3 and E5 at no extra cost, but not for consumer licenses. In addition to the basic offering, Microsoft offers a variant with an additional charge that provides premium compute access in the Azure cloud.

Further details on the general availability of Python in Excel can be found on Microsoft's Excel blog.

(rme)

Don't miss any news – follow us on Facebook, LinkedIn or Mastodon.

This article was originally published in German. It was translated with technical assistance and editorially reviewed before publication.