Advertisement

Microsoft Excel will soon let you run Python scripts as formulas

MS Excel Logo

Microsoft is bringing Python programming into Microsoft Excel, empowering users with more advanced data analysis capabilities. The Python integration is now in public preview for select Microsoft 365 Insiders. This means users can now wield the mighty Python to craft potent functions for data analysis and manipulation, all within the familiar confines of the spreadsheet software.

A Sneak Peek for the Inquisitive

For those eager to jump aboard the Python-Excel train, the public preview of this feature is currently available to Microsoft 365 Insiders in the Beta channel. But before you go all-in, note that Microsoft is cautiously releasing this functionality in stages to ensure a smooth experience.

Using the Python Panda library in Microsoft Excel
Using the Python Panda library in Microsoft Excel

The new Python in Excel feature introduces the ‘PY’ function, which allows users to embed Python code directly into a cell. Think of it as merging a macro with an Excel function, only with Python’s magic touch. What’s unique is that instead of running these Python scripts locally, Excel will execute them in the cloud using a secure container on Azure Container Instances.

A Security Dance with Libraries

Safety is paramount. and to ensure that, a curated set of Anaconda libraries, including tools like ‘pandas’ for data analysis and ‘Matplotlib’ for visualization, are included in the container environment. This prevents potential security issues while providing the tools needed for effective Python scripting.

Also Read: How to use spatial audio on Microsoft Teams

Scripts are executed within an isolated cloud container. This means they won’t have access to local resources like your computer, network, or files. Security buffs will also be pleased to know that the execution is anonymous, ensuring your Python wizardry remains incognito.

A Seamless Fusion of Python and Microsoft Excel

With Python in Excel, you can weave Python’s analytical capabilities into your workbooks effortlessly. Use the =PY() function, enter your Python code, and let the cloud container handle the rest. Your results, including visuals and plots, neatly appear in the worksheet.

Microsoft treats embedded Python scripts much like other scripting languages, protecting you from potentially malicious content. Any document flagged with a Mark of The Web (MoTW), which indicates a possible threat, won’t execute Python formulas or macros.

Conclusion

To get your hands on this feature, join the Microsoft 365 Insider Program and hop onto the Beta channel. Keep in mind that Microsoft is pacing the release, so patience might be your best coding companion. The marriage of Python and Excel is a harmonious symphony for data enthusiasts looking to supercharge their spreadsheets. So whether you’re a seasoned programmer or just someone who loves crunching numbers, the Python-Excel duo promises a whole new realm of possibilities to explore.

Muchiri Avatar

Leave a Reply

Your email address will not be published. Required fields are marked *