Python in Excel code editor
Applies To
Excel for Microsoft 365Python in Excel is now available to Enterprise and Business users running the Current Channel on Windows, starting with Version 2407 (Build 17830.20128), and Monthly Enterprise Channel on Windows, starting with Version 2408 (Build 17928.20216). It’s available in preview for Family and Personal users running the Current Channel on Windows starting with Version 2405 (Build 17628.20164). Python in Excel is 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.
It's rolling out to Excel for Windows first, 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.
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.
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.
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.
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.