Python in Microsoft Excel: The Ultimate Data Duo

Capicua
4 min readSep 4, 2023

--

Credits: Capicua

That’s right. Two of the most powerful Data Analytics and Visualization tools have joined forces. If you’re like me, you probably thought Microsoft bought Python and added it to one of its most powerful tools, Excel. While it would’ve been very Microsoft-ish, based on its recent moves, that’s not the case. So, what happened? Microsoft partnered with Anaconda (striking move, I know) to develop this new Python feature for its golden tool. For many years, you could only rely on Visual Basic for Applications (VBA) to handle programming tasks within Excel. Now, those days are finally over. Let’s explore the implications of two of the most important tools in the software development industry working together.

The Power of Microsoft Excel

Microsoft Excel is one of the most important software tools ever developed. First launched in 1985, Excel revolutionized how we interact with data, quickly becoming extremely popular and almost a synonym of spreadsheet. Its advanced out-of-the-box functions gave us the power to perform and automate complex business tasks in minutes. Despite being nearly four decades old, people still use Excel in many of the most in-demand professions. That includes business analysis, data management, accounting, finances, reporting, planning, and budgeting.

Around 54% percent of businesses reported using Excel in a 2019 study. In this manner, experts claim Excel is still essential to the management of most companies. That said, combining it with the second most popular language in the world was smart. As mentioned above, Microsoft partnered with Anaconda to bring the power of Python to Excel with the help of Python’s creator, Guido Van Rossum, working as a Microsoft Engineer. That’s more than enough to say they did a remarkable job.

How Does Python Work In Excel?

Python in Excel is available in the Microsoft 365 Insider Program under the Beta Channel as a public preview. We can expect it to reach more applications with time. But that’s just the beginning. There are plenty of good news here. Since Microsoft teamed up with Anaconda, you don’t need to worry about any setup or Python version to get started. Microsoft uses Azure Cloud to run your code, so you don’t have to do it locally on your machine. Also, they’ve added a new “PY” formula that lets you access and write Python code against Excel cells.

In other words, you can get started in a matter of seconds. Along with the most popular Python Libraries for Machine Learning and Data Science, Excel gives you pre-written code from 400 packages. That includes Matplotlib, Scikit-learn, Pandas, Seaborn, Statsmodels, and SciPy. That’s what Anaconda recommends using for Data Analysis in Excel. The practical use case they showed us involved creating a data frame from Excel cells using the Python PY function and Pandas. One thing to remember: Python cells calculate in row-major order, left to right and top to bottom. That means your data frame has to be above or located to the left of the Python cells that reference it.

Will Python in Excel Be A Game-Changer?

As exciting as having Python in Excel sounds, some people may be skeptical about this idea. The truth is that Excel can accomplish a lot on its own when you master it. Besides, what if you’re an Excel practitioner and a Data Analyst who hasn’t written a single line of code? On the one hand, as Anaconda put it, Python in Excel redefined what’s possible within data analytics. Regarding data visualization, libraries like Seaborn and Matplotlib give you tons of new graphics to present your Excel data. Other libraries like Pandas and Numpy let you analyze and clean data without using Pivot Excel tables. Plus, they do it much more efficiently.

On the other hand, thanks to the power of ChatGPT and GPT-4, you can write code in any programming language, provided you use the right prompts. Besides, Microsoft 365 Copilot will make this process more straightforward within Excel. This way, the Python feature will help Excel users with zero coding experience dive into advanced Data Visualization, Statistical Analysis, and Machine Learning. Working in collaboration with teams will be fairly easy since everyone can access the same tools within Excel. Plus, other tools like Microsoft Outlook and Teams make sharing the work easier. Regarding developers, they can use Python in Excel to write their custom functions.

Final Thoughts

Python in Excel is in its early stages, so we’ve only seen the tip of the iceberg. That also explains why only Microsoft 365 Insider, who have access to the Beta Channel, can use it. Undoubtedly, it’ll be more accessible to more people sooner rather than later. As Anaconda pointed out, this feature will be available for Mac users “at a future date.” With some time, they’ll most likely incorporate coding features that will make this tool even more powerful. Things like autocompletion and code suggestions. Microsoft and Anaconda have taken how we interact with data to the next level, giving us a new world of possibilities.

“I’m excited that this excellent, tight integration of Python and Excel is now seeing the light of day. I expect 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!” — Guido van Rossum, Python Creator.

Written by Manuel Aparicio, Copywriter at Capicua.

--

--

Capicua

We build products with identity and soul to harness technology for a better future. We are Capicua. 🚀 https://www.wearecapicua.com