Microsoft Announces 'Python in Excel'

Microsoft today announced the availability of a public preview of "Python in Excel," a new feature that combines the capabilities of the popular Python programming language with Microsoft's ubiquitous Excel spreadsheet application to deliver better visualizations and native analytics.

The new feature is available for those in the Microsoft 365 Insiders program, using the Beta Channel in Excel for Windows.

Python in Excel will be integrated directly into the fabric of Excel, giving users access to new analytics capabilities for visualizations, cleaning data, machine learning, and predictive analytics, the company said. A new "py" function allows Python to be used seamlessly withing the grid, the company said. No installation is required; they "py" function appears automatically.

“You can manipulate and explore data in Excel using Python plots and libraries, and then use Excel’s formulas, charts and PivotTables to further refine your insights,” said Stefan Kinnestrand, general manager of modern work at Microsoft, in a blog post. “Now you can do advanced data analysis in the familiar Excel environment by accessing Python directly from the Excel ribbon.”

The Python integration will allow Excel users to clean and manipulate their data, train machine learning models, create compelling plots, and more, all within the familiar Excel environment, Kinnestrand said. Excel's built-in connectors and Power Query allow users to bring external data into their Python in Excel workflows. And the Python code runs on the Microsoft Cloud as a compliant Microsoft 365 connected service.

Microsoft is partnering with Anaconda, a leading Python repository, to integrate its Anaconda Distribution, a free Python/R data science distribution, running in Azure.

"For Excel users, this opens a new world of data analysis potential previously limited to data scientists and developers," said Christian Capdeville, director of product marketing at Anaconda, in a blog post on the Anaconda website. "Within your familiar spreadsheet environment, you can now harness Python’s power to perform complex statistical analyses with popular packages such as pandas and statsmodels and create sophisticated visualizations using Matplotlib and Seaborn. Python practitioners can now marry scripts and rich visualizations with the widespread accessibility of Excel, enabling an uninterrupted workflow and making your work easier to share with colleagues who primarily use Excel."

Python, which is an interpreted, object-oriented, high-level programming language with dynamic semantics, has consistently topped the programming language popularity charts. One aspect of Python's appeal is the long list of open-source Python libraries. Python in Excel will initially support Pandas, which is used for working with relational or labeled data and comes with functions for analyzing, cleaning, exploring, and manipulating data; and Matplotlib, cross-platform, data visualization and graphical plotting library, Microsoft said.

"You can use powerful Python libraries right within your Excel workbook to create visualizations, machine learning models, and other advanced analytics," the company said.

That long list of Python libraries includes TensorFlow (created by Google brain; popular for deep learning and machine learning algorithms); PyTorch (popular for natural language processing); Keras (supports nearly all neural network models); and NumPy (hugely popular for scientific computation).

Python's simple, easy-to-learn syntax and English-like commands have made it a favorite in schools for students new to computer programming. But it's also proved to be a useful language for office environments, where it has been adopted by non-programmers, such as accountants and scientists, for such tasks as organizing finances.

About the Author

John K. Waters is the editor in chief of a number of sites, with a focus on high-end development, AI and future tech. He's been writing about cutting-edge technologies and culture of Silicon Valley for more than two decades, and he's written more than a dozen books. He also co-scripted the documentary film Silicon Valley: A 100 Year Renaissance, which aired on PBS.  He can be reached at