Related topics
×
Sign in with Microsoft
Sign in or create an account.
Hello,
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 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 issues 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

Feature requirements

Review the following requirements list before troubleshooting errors.

Platform availability 

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

For additional availability information, see Python in Excel availability

Internet access 

Python in Excel requires Internet access because calculations run on remote servers in the Microsoft Cloud. The calculations are not run by your local Excel application. 

Troubleshoot Excel errors  

Python in Excel calculations can return standard Excel errors to Python cells, such as #PYTHON!, #BUSY!, and #CONNECT!. 

Access the error message 

To learn more about how an Excel error applies to your Python formula, open the error message. To open the error message, select the error symbol next to the cell and then select Show Error Message from the menu. The following screenshot shows the error menu containing Show Error Message.

  An error in a Python in Excel cell, with the error menu open.

Next, Excel displays a Python Error Message with additional information. In this case, the #PYTHON! error is the result of invalid Python syntax on line 1 in the Python formula.

...  

Note: The diagnostics task pane automatically opens in Excel if the #PYTHON! error is returned. See the #PYTHON! error information in the following section to learn more about the diagnostics task pane.

Common errors

#BLOCKED!

Python in Excel must be enabled in a workbook for Python formulas to calculate. If you see the #BLOCKED! error, ensure that you have access to Microsoft 365 connected services.

#BUSY!

The #BUSY! error indicates that Python calculations are running in the Microsoft Cloud. If the #BUSY! error displays for longer than 60 seconds, try resetting the Python runtime. From the Formulas tab, in the Python group select Reset runtime. Or use the keyboard shortcut Ctrl+Alt+Shift+F9.

#CALC!

Python in Excel doesn't support references to cells with volatile values, such as cells using the RAND function. Python formulas that reference cells with volatile values return the #CALC error.

Python in Excel calculations can process up to 100 MB of data at a time. Attempting to run a calculation with more than 100 MB of data returns the #CALC! error. Try using a smaller dataset.

#CONNECT! 

Try refreshing the connection with the Microsoft Cloud by resetting the Python runtime. From the Formulas tab, in the Python group select Reset runtime. Or use the keyboard shortcut Ctrl+Alt+Shift+F9.

#PYTHON!

The #PYTHON! error likely indicates a Python syntax error. The diagnostics task pane automatically opens if the #PYTHON! error is returned. Check the diagnostics task pane to see details about the error. 

View the diagnostics task pane  

The diagnostics task pane displays in the Excel UI, to the right side of the grid. Use the diagnostics task pane to continuously view standard outputs, standard errors, and interpreter errors with your Python in Excel calculations. To manually open the diagnostics task pane, go to a Python cell in the worksheet, open the context menu (right-click or Ctrl+click on the cell) and select Diagnostics for this cell

The following screenshot shows the diagnostics task pane displaying one error: a syntax error for a Python formula in cell C1.

The Python in Excel diagnostics task pane, showing a syntax error.

#SPILL!

The #SPILL! error likely indicates that a cell in the Python output range already contains data. This could be the result of returning a Python object as Excel values. The Excel values may spill across multiple cells. See How to correct a #SPILL! error for resolution strategies. 

#UNKNOWN!

The #UNKNOWN! error in a Python cell likely indicates that your version of Excel doesn’t support Python in Excel. To learn more, see the Feature requirements section earlier in this article. 

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!

×