Skip Navigation Links.
🏠Home
Collapse 💻Apps💻Apps
🍵HTML Editor
🍵Unicode Symbols
Collapse 📂Topics📂Topics
Collapse 📄Data Analysis Expressions ...📄Data Analysis Expressions ...
Collapse 📄Complete List of DAX Fun...📄Complete List of DAX Fun...
📄ABS...
📄ACCRINT...
📄ACCRINTM...
📄ACOS...
📄ACOSH...
📄ACOT...
📄ACOTH...
📄ADDCOLUMNS...
📄Using DAX to split colum...
Collapse 📄MS Office...📄MS Office...
📄MS Access...
Collapse 📄MS Excel...📄MS Excel...
Collapse 📄Ribbon...📄Ribbon...
Collapse 📄Home...📄Home...
📄Alignment...
📄Cells...
📄Clipboard...
📄Editing...
📄Font...
📄Number...
📄Styles...
Collapse 📄Insert...📄Insert...
📄Charts...
📄Illustrations...
📄Tables...
Collapse 📄Office Scripts...📄Office Scripts...
📄VBA to TypeScript: A S...
Collapse 📄Power BI...📄Power BI...
Collapse 📄Get Data...📄Get Data...
📄Get Data from Files...
📄View any visual as table...
Collapse 📄Power Query / M Language...📄Power Query / M Language...
📄Entering Data without Da...
📄Data Source Settings...
Collapse 📄Practice Datasets...📄Practice Datasets...
📄Kaggle Datasets...
Collapse 📄SQL Datasets...📄SQL Datasets...
📄Adventure Works (SQL S...
📄Star Bakery (MySQL Ser...
📄Star Corp (SQL Server)...
Collapse 📄Python...📄Python...
📄Fill missing values in M...
📄List of Machine Learning...
📄Python for MS Excel...
📄Seasonal Autoregressive ...
📄Working with Random Valu...
Collapse 📹Video Tutorials📹Video Tutorials
🎬Advanced Power BI Realtime...
🎬Real time Monitoring with ...
🎬Creating and Using Flow Ma...
🎬How to create terrain, add...
🎬Game Design Tutorial for B...
🎬Dashboard with Relational ...
🎬Power Pivot and Data Model...
🎬Selecting Project using Pr...
🎬Two Ways to Use Custom SQL...
🎬Diversity, Equity, and Inc...
🎬Complete Guide to Using Dr...
🎬Gantt Chart in Power BI: C...
🎬Monitoring Progress Using ...
🎬Creating a Dashboard of Sa...
🎬Indigeno Technologies - Pa...
🎬Creating and Publishing We...
🎬Make Your Data Grow: Tree ...
🎬Power BI: Adding Historica...
🎬We asked an AI to create a...
🎬Power BI: Staff Engagement...
🎬Using Unicode Symbols in E...
🎬Power BI: Timesheet Analys...
🎬Time Machine for Your Data...
🎬Azure Data Studio - Comple...
🎬Power BI: Creating a Stunn...
🎬Power BI: Project Payback,...
🎬Power BI: Complete Realtim...
🎬Power BI: DAX Query View f...
🎬Build Your Own Excel Toolb...
🎬Data Science Programming: ...
🎬Power BI: Manage and Track...
🎬MS Excel: Using Images in ...
🎬MS Excel: Complete Guide t...
🎬Power BI: Creating Dashboa...
🎬Power BI: Using Latest Pre...
🎬Power BI: Performing Compa...
🎬Power BI: Creating Dashboa...
🎬Python: Forecasting with S...
🎬Power BI: Creating a Dice ...
🎬MS Excel: Creating a Dynam...
🎬Power BI: Create stunningl...
🎬MS Excel: Data Visualizati...
🎬Power BI: Assets Managemen...
🎬Power BI: Using Copilot in...
🎬Power BI: How to Create a ...
🎬MS Excel: Complete Guide t...
🎬Power BI: Easily Pivoting ...
🎬Power BI: How to Create a ...
🎬MS Excel: Using Python Rea...
🎬MS Excel: Realtime/Live Da...
🎬Power BI: Creating Paginat...
🎬Power BI: Exploring PBI On...
🎬MS Excel: Mastering MS Exc...
🎬MS Excel: Performing Non-L...
🎬MS Excel: How to add lates...
🎬Power BI: Performing PESTL...
🎬Power BI: Creating an Exot...
🎬Python: Resizing and Conve...
🎬Power BI:The Clock - Episo...
🎬MS Power Point: The Clock ...
🎬Looker Studio: Setting up ...
🎬HTML: Complete Course for ...
🎬Power BI: Creating a Power...
🎬MS Excel: Best Way to Crea...
🎬Power BI: Setting up Repor...
🎬Power BI: Real-time Data R...
🎬MS Excel: Mastering Excel ...
🎬SQL: Creating Realtime Liv...
🎬SQL: SQL Server Reporting ...
🎬Power BI: Data Modeling an...
🎬MS Excel: Data Modeling an...
🎬Python: Mastering NumPy Li...
🎬Power BI: Automating Data ...
🎬Power BI: How to Build a P...
🎬Power BI: Displaying Realt...
🎬Power BI: Unlocking Insigh...
🎬Power BI: How to Create a ...
🎬Power BI: Comparing Variou...
🎬Power BI: Animate Your Vis...
🎬MS Excel: Using Formulas l...
🎬Power BI: Using Folders as...
🎬Power BI: Using Folders as...
🎬Python: Uploading Files Di...
🎬Power BI: Creating Stunnin...
🎬Power BI: Integrating Pict...
🎬Power BI: Crafting Dynamic...
🎬Power BI: Dealing with Err...
🎬Power BI: Creating Dynamic...
🎬MS Excel: Calculating, Com...
🎬Power BI: Exploratory Data...
🎬Power BI: Create an Intera...
🎬Python: Creating Polynomia...
🎬Looker Studio: Creating Dy...
🎬Google Charts: Using Googl...
🎬Looker Studio: Understandi...
🎬Python: Mastering Data Vis...
🎬Power BI: Realtime Simulat...
🎬Power BI: Connecting to an...
🎬Python: Performing basic S...
🎬MS Excel: Simplifying Comp...
🎬Power BI: How to Create Hi...
🎬MS Excel: How to Use Calcu...
🎬Power BI: Using Small Mult...
🎬Power BI: Performing Finan...
🎬Power BI: Displaying SQL D...
🎬Power BI: Displaying Audit...
🎬Power BI: Loading Data int...
🎬Power BI: Using SQL Query ...
🎬Power BI: Visualizing Basi...
🎬MS Excel: Create a Smart, ...
🎬Power BI: Realtime Plant S...
🎬Power BI: Analyzing Season...
🎬Power BI: Creating your fi...
🎬Power BI: Creating Paginat...
🎬Power BI: Creating a Key P...
🎬Power BI: Creating Data So...
🎬Power BI: Setting up Power...
🎬Creating and Setting up a ...
🎬Power BI: Creating Pareto ...
🎬Power BI: Realtime Call Ce...
🎬Power BI: Creating a Proje...
🎬Power BI: Displaying Live ...
🎬Power BI: Using Conditiona...
🎬MS Excel: How to Create Re...
🎬Power BI: Realtime Sales S...
🎬Power BI: Displaying Realt...
🎬MS Excel: Using Excel Slic...
🎬Tableau: Tutorial for Begi...
🎬Power BI: How to Use Bookm...
🎬MS Access: How to Create R...
🎬MS Excel: Using What If An...
🎬Power BI: Create a YouTube...
🎬Power BI: Correlation Anal...
🎬Power BI: Analyzing Murder...
🎬Power BI: Manage and Monit...
🎬MS Excel: Creating an Anim...
🎬MS Excel: Creating 3D Maps...
🎬Power BI: Analyzing Wareho...
🎬MS Excel: How to add seria...
🎬Power BI: Mastering Market...
🎬MS Excel: What lies beneat...
🎬MS Excel/Power BI: Unpivot...
🎬Power BI: Exploring Defaul...
🎬MS Excel: Using the Break-...
🎬MS Excel: Predicting Sales...
🎬Power BI: Market Basket An...
🎬MS Excel: Creating a Bell ...
🎬Power BI: Creating a Dimen...
🎬Looker Studio: Creating a ...
🎬R: Creating Your First Pie...
🎬MS Excel: Conditional Form...
🎬Power BI: Analyzing human ...
🎬Python: Unleashing the Pow...
🎬Excel: Mapping, Grouping a...
🎬Power BI: Forecasting Data...
🎬Power BI: Grouping Data in...
🎬JavaScript: Using the if-e...
🎬Power BI: Connecting to th...
🎬JavaScript: Performing Mat...
🎬Power BI: Analyzing Bank L...
🎬MS Excel: Pivot... Pivot.....
🎬JavaScript: How to use onC...
🎬Power BI: Using Sankey Dia...
🎬Power BI: Multi Page Power...
🎬JavaScript: How to use onL...
🎬JavaScript: How to get the...
🎬Power BI: Crimes in Los An...
🎬Power BI: Crimes in Los An...
🎬Excel: Using the Fill Feat...
🎬Power BI: Drill-through Re...
🎬Power BI: Using DAX (Data ...
🎬Power BI: Using Smart Narr...
🎬Power BI: Bank Failure in ...
🎬Python: Predicting absente...
🎬Power BI: Dashboards with ...
🎬Power BI: Team and Product...
🎬Excel: Lookup Functions, V...
🎬Power BI: Artificial Intel...
🎬Power BI: Drill Down Repor...
🎬Python: Creating a GUI bas...
🎬Power BI: Visualizing Stoc...
🎬Python: Expected Returns (...
🎬Power BI: Decomposition Tr...
🎬Power BI: Sales and Profit...
🎬Python: Why you should not...
🎬Python: How to save, reloa...
🎬Power BI: Dimensional Mode...
🎬Python: How to classify da...
🎬Python: Machine Learning, ...
🎬Python: Web Scraping using...
🎬Animate: Classic Tween in ...
🎬Python: Support Vector Mac...
🎬Python: How to perform loo...
🎬Unity3d: How to create ter...
🎬Python: How to create and ...
🎬Python: How to work with a...
🎬Python: How to work with p...
🎬Python: How to work with S...
🎬SQL: How to create databas...
🎬Python: Data Scraping from...
🎬MS Excel: Pivot Tables, Pi...
🎬Python: How to use World B...
🎬MS Excel: How to use COUPD...
🎬Power BI: How to install P...
🎬Python: Easiest way to dow...
🎬MS Excel: How to use AMORD...
🎬MS Excel: How to use ACCRI...
🎬Python: Calculating varian...
🎬MS Excel: How to calculate...
🎬Python: How to calculate a...
🎬MS Excel: How to calculate...
🎬Python: How to calculate a...
🎬MS Excel: How to calculate...
🎬Python: How to calculate a...
🎬MS Excel: How to calculate...

📄Fill missing values in MS Excel data using Python for Excel

On various ocassions, we have data with missing values. This kind of data messes up our analysis or whatever we are working on. Even worse, if this data needs to be exported to a database such as SQL server or MS Access, it will result in a lot of errors. If a field in database is defined as number, and it is blank, it will result in errors during upload process. However, if it null values are allowed and gets uploaded, that is even far worse, because at a later stage, there will be multiple errors during calculations.

There are many ways we can fill the missing data. After introduction of Python for Excel, we can use Python to fill the missing data as well. Filling the missing data using Python is more effecient, specially if an advanced method is used where data is guessed and filled with the most appropriate guess.

Suppose we have a data [1,2,N/A,4,5] where `3` is missing. We can either use the dataframe.fillna(0), and fill the missing values with zeros. This will make sure that the data is properly uploaded into a database, and no errors are faced during any calculation. Missing data will have no impact, as it is filled with zeros. Our revised data will be [1,2,0,4,5]. You can fill missing values with any value you want using this function. Just replace `0` with that number.

Another method is to use dataframe.bfill(), which will fill all missing values, with the next value. In that case the revised data will be [1,2,4,4,5]. Or you can use dataframe.ffill(), which will fill all missing values, with the previous value. The revised data will be [1,2,2,4,5]. If the data is in sequence, the missing value should be closer to the one before or after the missing value, which serves the purpose in some cases.

You can also use the dataframe.interpolate() which will accurately guess the missing value in this case and the revised data will be [1,2,3,4,5]. So using python you can use any number of methods for data cleansing and filling up the missing values.

dataframe.interpolate