Blog Post

Excel Blog
3 MIN READ

Graduating the Python Editor to Insiders: Beta

Chris_Gross's avatar
Chris_Gross
Icon for Microsoft rankMicrosoft
Jul 10, 2024

 

What is happening?

Back in September, we shipped a new experiment to the Excel Labs add-in. This experiment allows you to write and edit Python formulas in Excel using a dedicated code editor with similar capabilities as those available in Python notebook environments.

 

We are happy to share that we are making the editor available as an in-the-box option, and we have improved the appearance and usability of the Python Editor. You’ll see a slightly different user interface that stays faithful to the original design, and we have more to come!

 

 

The Python Editor enhances the Python in Excel experience by providing a bigger editing space for writing larger code blocks as well as productivity features.

 

From the Python Editor, you can see a list of all the Python cells in your spreadsheet. Each cell is treated like that of a code cell in a Jupyter notebook. Within the Python Editor pane, you can edit the cells and run them. The output of the Python cell can be displayed natively in your Excel spreadsheet, whether it is plain text, numeric, or even a visualization or DataFrame.

 

This new Python Editor is powered by the same technology that supports notebooks in other popular Microsoft products so you can use the full range of editor features like Intellisense, colorization, and function help as you code in Excel.

 

With the addition of the Python Editor as a built-in Python in Excel feature, we are excited to further enhance your Python development experience.

 

What are the benefits of the Python Editor?

The Python Editor offers several benefits when writing and editing Python formulas in Excel.

 

See the flow of code execution with results: The Python Editor shows Python cells in execution order in addition to the output of each cell’s code, which can help you more easily debug and understand your code. This is useful because, Python in Excel cells execute in row major order.

 

Easily edit longer chunks of code: The Python Editor provides a new way to create and edit your Python code, offering more immersion when working with longer scripts.

 

 

Gain flexibility with coding workflows: The Python Editor allows you to write code, click elsewhere in the application, but not commit the code to Excel until you are happy with it. This gives you more flexibility and control over when and how you apply your code to your workbook. Additionally, when in manual recalc mode, editing and committing from the Editor will calculate just that cell (like a notebook) providing a faster feedback loop.

 

 

Try it today!

For the near term, there will still be two versions of the Editor, making it available wherever Python in Excel is available

Built into Excel: If you are using Insiders: Beta, we have now begun the rollout and you can try out the feature by going to the ribbon and opening the “Editor” button in the “Formulas” tab. It’s next to Insert Python.

 

 

Excel Labs: The Python Editor will remain in Excel Labs as we ship to additional audiences. If you aren’t in Insiders: Beta, please refer to our original blog post for installation instructions.

 

Access Requirements

You need to have access to Python in Excel to make use of the Python Editor. For more information on how to get access to Python in Excel, please check out our accompanying post  Python in Excel

 

We want your feedback!

Excel and Python users can give feedback directly within the application (go to Help > Feedback), suggest improvements on our Feedback portal, or engage with our team on GitHub.

Updated Jul 17, 2024
Version 3.0
  • Looks great, will play with it on weekend. By the way, are you going to integrate AFE by the same or similar way?

  • Sameer_Bhide's avatar
    Sameer_Bhide
    Iron Contributor

    Any plans of shifting the Excel Formula editor out of the garage in to Excel ?

     

    Cheers

    Sam

  • Andrew_Duncan54's avatar
    Andrew_Duncan54
    Copper Contributor

    It is still not available for Excel for MAC. However, I gave it a try on Excel on my Windows 10 virtual machine. Initially, I did not find it particularly intuitive, but I eventually got the hang of it. What I did notice is that it is rather slow at running relatively simple UDF. If you want to do anything that requires a bit more calculating grunt, you would be better off writing a VBA UDF.

  • enriquenorton's avatar
    enriquenorton
    Copper Contributor

    Hello, I am trying the Python option in Excel.
    I have a program made in Python and I wanted to put it in Excel, because it works with Excel.
    The issue is that I need to define a working directory and I have used a script to verify which directory I am in and it always shows /app, what could it be?
    The excel file is saved in the same directory where I want to work from.
    Thank you.

  • Adeltech's avatar
    Adeltech
    Copper Contributor

    ثورة التكنولجيا ..

    شيء لايوصف