Applies ToExcel for Microsoft 365 Excel for Microsoft 365 for Mac Excel for the web Microsoft365.com Microsoft Office

Python in Excel is available to Enterprise and Business users running the Current Channel on Windows, starting with Version 2408 (Build 17928.20114), and Monthly Enterprise Channel on Windows, starting with Version 2408 (Build 17928.20216). It's also available in Excel on the web for Enterprise and Business users. Python in Excel is available in preview for Family and Personal users in Excel on the web or running the Current Channel on Windows starting with Version 2405 (Build 17628.20164). It's available in preview for Education users running the Current Channel (Preview) through the Microsoft 365 Insider Program. It's not currently available for the Semi-Annual Enterprise Channel.

Python in Excel is available in preview on Excel for Mac through the Microsoft 365 Insider Program. Choose the Beta Channel Insider level and install the latest build of Excel. It's available starting with Version 16.95 (Build 25021921).

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.

New to Python in Excel? Start with Introduction to Python in Excel and Get started with Python in Excel.

The code editor task pane

The Python in Excel code editor is a task pane that provides an editing space for large code blocks when authoring Python in Excel formulas. It shows all the Python code in your workbook, listed by worksheet and cell number. The code editor also includes features like IntelliSense and text colorization to support editing large blocks of code.

Note: The Python in Excel code editor is currently available to Enterprise and Business users running the Current Channel on Windows, starting with Version 2410 (Build 18129.20116). It's also available in Excel on the web for Enterprise and Business users. It's available in preview for Family, Personal, and Education users through the Microsoft 365 Insider Program.

Shows the open task pane and multiple Python cells in the task pane.

To open the Python in Excel code editor, select a Python cell in your workbook and then go to Formulas > Editor. This opens the task pane and displays all the Python cells in your workbook.

Editing options in the task pane

Within the code editor task pane, you can edit each Python cell in your workbook. Use the menu above each cell in the task pane to save and run a Python cell, switch between output types (from Python object to Excel value), undo changes, or expand a cell to a larger code editing area.

The menu options for each Python in Excel code editor cell.

Filter within the task pane

Use the filter at the top of the task pane to narrow the content displayed in your code editor task pane, such as only displaying Python cells on the current worksheet or only displaying Python errors.

Use the filter at the top of the task pane to narrow your content.

Display Python output in the task pane

The output of each Python cell in the code editor task pane is displayed in your Excel workbook. You can also see the output in the code editor task pane by expanding the output type at the bottom of each code block.

Expand the output to see images and other output data.

Related articles

Python Editor - Now Available

Graduating the Python Editor to Insiders: Beta

Need more help?

Want more options?

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