Premium video tutorials
Learn at your own pace
Mobile (learn on-the-go)
Unlimited tests and quizzes
Regularly updated content
In this beginner-friendly course, you will learn how to use Python with Excel in tandem to drastically improve your data crunching and analysis skills.
In 40 short lessons, you will combine the power of Python and Excel using openpxyl to create, manipulate, and present data.
By the end of the course, you will be able to create spreadsheets, crunch data, and present information as charts and graphs solely using Python commands.
Using Python for Excel is ideal for those who work closely with databases or large spreadsheets, or who are interested in learning more about data analytics.
The course only requires a basic understanding of Excel and doesn’t require any previous Python or coding experience.
In this course, you will learn how to:
- Download and install Python, Sublime Text, Git Bash, and Python openpxyl
- Create your first python program
- Use variables, print (), lists, tuples, and loops
- Create workbooks and worksheets using Python
- Read and open Excel files in Python
- Use Excel formulas in the Python terminal
- Manipulate data and spreadsheets using Python
- Format and style spreadsheets using Python
- Create basic and advanced charts and graphs
- Create and manipulate tables
- Add images to Excel spreadsheets using Python
Estimated study time
20h for all materials
Installation and Setup
We'll spend a few minutes discussing what we'll learn throughout the course.
Download and Install Python
In this lesson, we'll download and install the Python programming language.
Download and Install Sublime Text
We're going to use the Sublime Text Editor to write our code in this course. So in this lesson, we'll download and install Sublime Text.
Download and Install Git Bash
To run the Python programs that we write, we need a terminal. We'll be using the git bash terminal in this course, so let's show how to download and install Git Bash.
To use Python properly, we create a virtual environment. In this lesson, we'll explain how to set one up.
Introduction To Python Programming
Your First Python Program
In this lesson, we'll create our first Python program, called hello.py.
Python Variables and Print()
In this lesson, we'll discuss how to store data within your program using variables and how to display them using the Print() command.
Python lists are used to keep track of a list of items. They can be text, numbers, variables, other lists and more.
Tuples are just like lists, but they can't be changed once created. Let's discuss how to create and reference them.
Python For Loops
For loops are used to loop through things like lists or groups of data.
In this lesson, we'll show how to generate random numbers.
Introduction to OpenPYXL
Pip Install openpyxl and import
openpyxl is the Python library that we'll use to connect our Python code to Excel.
Creating Workbooks and Worksheets
To work with workbooks and worksheets in excel, we need to import some things from openpyxl.
Load Existing Excel File and Grab One Cell
To load data from an existing Excel spreadsheet, we need to import load_workbook from openpyxl.
Change Existing Cells - Method 2
There's more than one way to change data in a spreadsheet cell. This method is handy to use when looping using For Loops.
Using Excel Formulas
Using Excel formulas in our Python code is easy!
Existing Excel - Cell Range
In this lesson, we'll discuss how to grab a whole range of cells.
Existing Excel - Column and Column Range
We can grab an entire column of data from an Excel spreadsheet.
Existing Excel - Row Range
Use this method when you want to grab an entire row - or a range of rows - from an Excel spreadsheet.
Existing Excel - Iterate Thru Rows
Let's discuss another method to iterate through rows in an Excel spreadsheet when you need a little more control.
Existing Excel - Iterate Thru Columns
Just like iterating through rows, we can also iterate through columns.
Hands on Exercise
Create Excel Spreadsheet Using Python and Random Numbers
Let's take what we've learned so far and put it to use with an exercise!
Formatting And Styling Spreadsheets With Python
Merge Cells and Unmerge Cells
In this lesson, we'll cover how to merge and unmerge cells.
Cell Font Properties
We can change the font color and sizing by using the font property.
In this lesson, we'll discuss methods to change the alignment of text in a cell.
Cell Fill (Pattern Fill)
Pattern Fill allows you to change the color and pattern of a cell.
Cell Fill (Gradient Fill)
We can easily change the gradient color of a cell in a spreadsheet.
Borders and Sides
In this lesson, we'll discuss how to change the border style and thickness of a spreadsheet cell.
Working With Charts And Graphs
Intro To Charts And Graphs - Pie Charts
In this lesson, we'll learn how to add Pie Charts to a spreadsheet.
Intro To Charts and Graphs - Bar Charts, Line Charts, Area Charts, ScatterCharts
There are many other basic charts you can use with openpyxl, such as bar charts, line charts, area charts, and scatter charts.
Bar Charts - Vertical, Horizontal, Stacked, and 3D
In this lesson, we'll look at Bar Charts - Vertical, Horizontal, Stacked, and 3D - in a little more detail.
Area Charts - 2D and 3D
In this lesson, we'll discuss how to add 2D and 3D Area Charts to your spreadsheet.
Let's show how to add Radar Charts to your spreadsheet.
In this lesson, we'll look at how to add Doughnut Charts.
We'll discuss how to add Surface Charts to your spreadsheet.
Use these steps to add a Bubble Chart to your spreadsheet.
Projected Pie Charts
In this lesson, we'll look at Projected Pie charts, which are pie charts with some chunks pulled out and projected to the side.
Creating Excel Tables
Tables - Part 1
Tables are good for sorting data manually in your spreadsheet, and for drilling down and re-imagining your data.
Tables - Part 2
In this lesson, we'll build a Table.
We'll cover how to add images to your spreadsheet.