MITB Banner

A Guide To PyXLL-Jupyter Package For Excel Integration

Last year, PyXLL released its PyXLL-Jupyter plugin. The new extension combines the ease of use of Excel with the interactivity of Jupyter.

Share

A Guide To PyXLL-Jupyter Package For Excel Integration

Last year, PyXLL released its PyXLL-Jupyter plugin. The new extension combines the ease of use of Excel with the interactivity of Jupyter. Once installed, you will be able to plot your data in Jupyter and have the ability to share them with Excel seamlessly. It can also open on Jupyter Notebook in a browser as well as in an Excel task pane. 

Excel comes with pivot tables, graphing tools, and a macro programming language known as Visual Basic for Applications (VBA). Jupyter Notebook, on the other hand, is an open-source web application that allows users to create and share documents that contain live code, visualisations, equations and narrative text. With the PyXLL-Jupyter package, you can use both together, side by side. 

VBA is commonly used to automate Excel with macros, add new user-defined worksheet functions (UDFs) and react to Excel events. The same is achieved with Python, as it is much faster. 

Founded in 2010, PyXLL is the brainchild of Tony Roberts. He started PyXLL after years of working with Python and Excel in the finance industry. PyXLL is one of the go-to tools for writing Excel add-ins in Python, especially for people working in data science roles. 

xiwings, DataNitro, Pandas, NumPy, Anaconda, SciPy, PySpark and DataForm, are some of the alternatives to PyXLL. 

How to Install PyXLL-Jupyter?

Firstly, to run Python code in Excel, you need the PyXLL add-in. ‘PyXLL add-in’ lets you integrate Python into Excel and use Python instead of VBA. To set up ‘PyXLL Excel add-in (pip install pyxll) and then use the PyXLL command line tool to install the Excel add-in

> pip install pyxll

> pyxll install 

Beginners can check out PyXLL’s online documentation here

Once you have successfully installed the PyXLL Excell add-in, the next step is to install the pyxll-jupyter package. This package essentially glues PyXLL and Jupyter so that you can use Jupyter Notebooks within Excel. 

The PyXLL-Jupyter package is installed using pip

> pip install pyxll-jupyter 

Once you have installed both the PyXLL Excell add-in and the PyXLL-Jupyter package, you will see a new ‘Jupyter’ tab in the PyXLL dashboard, as highlighted in the image below.

Button to open Jupyter in Excel
(Source: PyXLL)

Upon clicking this button, Jupyter Notebook opens in a side panel in your Excel workbook. This new panel is part of the Excel Interface and can be dragged to different locations at your convenience. 

In the Jupyter panel, you can select an existing notebook or create a new one. If you want to create a new notebook, select the ‘New’ tab followed by ‘Python 3,’ as shown in the image below. 

(Source: PyXLL)
(Source: PyXLL)

Further, to upgrade to the latest version of PyXLL-Jupyter, you can run pip install –upgrade pyxll-jupyter. 

PyXLL-Jupyter

Now that you have a complete Jupyter Notebook running inside of Excel, you can use Excel for working with your data and use Python to work on the same data. In other words, you can use Excel as an interactive playground for organising and visualising your data, effortlessly switching to Python for more sophisticated tools. 

Also, you can use Jupyter Notebooks as a scratch-pad for trying out Python code and write Excel functions entirely in Python in a Jupyter notebook and test them out in real-time. 

“Once you have developed a useful re-usable function, add it to your PyXLL Python project. That way, you can use the same function every time you see Excel,” wrote Tony Roberts, the founder of PyXLL. 

The key highlight of PyXLL-Jupyter include:

  • Share data between Excel and Python using your Jupyter Notebook
  • Write Excel worksheet functions (UDFs) in your notebook
  • Script Excel with Python instead of VBA 

Wrapping up

Python makes a powerful alternative to VBA. Using PyXLL, you can write fully featured Excel add-ins entirely in Python. At the same time, Excel is also a brilliant tool for interactive computation, and adding Python and Jyupter takes Excel to the next level. 

Plus, code written in Jupyter Notebook is easily refactored into standalone Python packages to create Excel toolkits to power intuitive Python tools written using PyXLL — without needing any knowledge of Python. PyXLL-Jupyter just simplifies the entire experience by providing both tools under one umbrella. 

Share
Picture of Amit Raja Naik

Amit Raja Naik

Amit Raja Naik is a seasoned technology journalist who covers everything from data science to machine learning and artificial intelligence for Analytics India Magazine, where he examines the trends, challenges, ideas, and transformations across the industry.
Related Posts

CORPORATE TRAINING PROGRAMS ON GENERATIVE AI

Generative AI Skilling for Enterprises

Our customized corporate training program on Generative AI provides a unique opportunity to empower, retain, and advance your talent.

Upcoming Large format Conference

May 30 and 31, 2024 | 📍 Bangalore, India

Download the easiest way to
stay informed

Subscribe to The Belamy: Our Weekly Newsletter

Biggest AI stories, delivered to your inbox every week.

AI Courses & Careers

Become a Certified Generative AI Engineer

AI Forum for India

Our Discord Community for AI Ecosystem, In collaboration with NVIDIA. 

Flagship Events

Rising 2024 | DE&I in Tech Summit

April 4 and 5, 2024 | 📍 Hilton Convention Center, Manyata Tech Park, Bangalore

MachineCon GCC Summit 2024

June 28 2024 | 📍Bangalore, India

MachineCon USA 2024

26 July 2024 | 583 Park Avenue, New York

Cypher India 2024

September 25-27, 2024 | 📍Bangalore, India

Cypher USA 2024

Nov 21-22 2024 | 📍Santa Clara Convention Center, California, USA

Data Engineering Summit 2024

May 30 and 31, 2024 | 📍 Bangalore, India

Subscribe to Our Newsletter

The Belamy, our weekly Newsletter is a rage. Just enter your email below.