Python in Excel is currently in preview and is subject to change based on feedback. To use this feature, join the Microsoft 365 Insider Program and choose the Beta Channel Insider level.
Python in Excel is gradually rolling out to Excel for Windows customers using the Beta Channel. At this time, the feature is not available on other platforms.
If you encounter any concerns with Python in Excel, please report them by selecting Help > Feedback in Excel.
What is Python in Excel?
Python in Excel brings the power of Python analytics into Excel. Use it to process data in Excel with Python code. You type Python directly into a cell, the Python calculations run in the Microsoft cloud, and your results are returned to the worksheet.
Python in Excel comes with a core set of Python libraries provided by Anaconda. Use Python libraries to simplify your data analysis, find patterns and hidden insights, and visualize your data with plots. To learn more, see Open-source libraries and Python in Excel.
How to enable the Python in Excel preview
To use Python in Excel, join the Microsoft 365 Insider Program. Choose the Beta Channel Insider level to get the latest builds of the Excel application.
Don’t have Insider access? You can sign up to be notified about future availability for Python in Excel. Sign up with your Microsoft, work, or school account to stay up to date.
After you've installed the latest Insider build of Excel, open a blank workbook and take the following steps.
-
Select Formulas in the ribbon.
-
Select Insert Python.
-
In the dialog that appears, select the Try preview button.
Note: You can also enable the Python in Excel preview by entering =PY into an Excel cell and then choosing PY from the function AutoComplete menu. Selecting the PY function will trigger a dialog that allows you to enable the preview.
Start analyzing data right away with Getting started with Python in Excel.
Platform availability
Python in Excel is available in Excel for Windows. The feature is not available in Excel for Mac, Excel on the web, Excel for iPad, Excel for iPhone, or Excel for Android. On unsupported platforms, workbooks containing Python can be viewed but Python cells display an error when recalculated.
Note: Python in Excel requires Microsoft Edge WebView2.
Python runs in the cloud
Python in Excel calculations run in the Microsoft Cloud with a standard version of the Python language. Python in Excel comes with a core set of Python libraries provided by Anaconda through a standard, secure distribution.
You don't need a local version of Python to use Python in Excel. If you have a local version of Python installed on your machine, any customizations you've made to that Python installation won’t be reflected in Python in Excel calculations.
Because Python in Excel calculations run in the cloud, Internet access is required to use the feature.