If you’ve been feeling constrained by Microsoft Excel’s methods for manipulating data, you’re in luck—Python can now be used within your spreadsheets. The inclusion of the popular programming language went live earlier this week, with the feature available as a public preview.
According to Microsoft, this integration is completely native within Excel; you won’t need to run any setup for it to work. (However, you will need to be part of the Microsoft 365 Insider program to access preview features in Office apps.) You type Python code directly into cells using the new =PY() function, which then gets executed in the cloud. The results are displayed in the worksheet. In the examples shown by Microsoft, common actions like creating pivot tables and charts will be possible using Python. Microsoft’s partnership with Anaconda, a Python repository that contains popular libraries like Matplotlib, pandas, and scikit-learn, should also enable more advanced visualizations.
The only potential limitation is that everything runs in the cloud—you won’t have any access to local installations of Python, including any customizations you may have set up. This is in part for security purposes; Microsoft says Python in Excel is secured through use of isolated containers, with the code running in a hypervisor in Azure. Online workbooks are also opened in separate containers. (You can read more about Microsoft’s data security practices regarding Python in this support documentation.)
To get started, you must be part of the Beta channel for Insiders, and running Excel for Windows (build 16.0.16818.20000). Microsoft says support for Python in Excel for other platforms will come “at a later date.” The feature is being rolled out gradually, however, so even Windows users may not immediately have access just yet. Also, some functionality will be eventually gated off for paid license holders. (Details to come closer to the official launch.) So if you want to be sure of unrestricted access to Python in Excel when first testing it out, you’re best off doing it during this preview phase.
Author: Alaina Yee, Senior Editor
Alaina Yee is PCWorld’s resident bargain hunter—when she’s not covering software, PC building, and more, she’s scouring for the best tech deals. Previously her work has appeared in PC Gamer, IGN, Maximum PC, and Official Xbox Magazine. You can find her on Twitter at @morphingball.
Recent stories by Alaina Yee:
I’m ditching my passwords—and you should tooBest free password managers 2024: Online security doesn’t have to cost a thingRoku’s massive hack is why you shouldn’t reuse passwords