Related topics
Sign in with Microsoft
Sign in or create an account.
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

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 Current Channel (Preview) Insider level.

This feature is gradually rolling out to Enterprise, Business, Education, and Family and Personal users running Current Channel (Preview) on Windows. It's rolling out to Excel for Windows first, starting with Version 2406 (Build 17726.20016), and then to other platforms at a later date. For more availability information, see Python in Excel availability.

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.

Announcing Python in Excel. Screenshot of an Excel workbook containing Python formulas.

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 and choose the Current Channel (Preview) Insider level.

Don’t have Insider access? Sign up with your Microsoft, work, or school account to be notified about future availability for Python in Excel.

I'm interested

Tip: Choose the Beta Channel Insider level to access Python in Excel features that haven't yet been released to Current Channel (Preview). 

After you've installed the latest Current Channel (Preview) build of Excel, take the following steps.

  1. Select Formulas in the ribbon.

  2. Select Insert Python.

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.

Important: While Python in Excel is in preview, all Excel for Windows customers using the Current Channel (Preview) or Beta Channel can add or edit Python formulas up to a limit. After exceeding the monthly limit, Python calculation speeds are reduced for customers that haven't enabled the Python in Excel preview. Enable the preview for access to faster calculations.

Start analyzing data right away with Get started with Python in Excel

Platform availability 

Python in Excel is available in Excel for Windows. The feature is not available on the following platforms.

  • Excel for Mac

  • Excel on the web

  • Excel for iPad

  • Excel for iPhone

  • Excel for Android

On unsupported platforms, workbooks containing Python can be viewed but Python cells display an error when recalculated. For more availability information, see Python in Excel availability.

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. To learn more, see Data security and Python in Excel.

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 computer, any customizations you've made to that Python installation won’t be reflected in Python in Excel calculations. 

To use Python in Excel, you need internet access.   

Preview terms of use

If you have a Microsoft 365 Family or Personal subscription, your use of this preview is governed by the Microsoft Services Agreement.

If you have a Microsoft 365 Business/Education subscription, your use of this preview is governed by the Product Terms. Also, please note that notwithstanding the limitations in the Preview provision of the Microsoft Products and Services Data Protection Addendum (DPA), the following terms in the DPA apply to this preview: Processing of Personal Data, GDPR, and Data Security.

Related articles 

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Was this information helpful?

What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!