Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 24

Missing Value Imputation

Recommended resources

Introduction

Welcome to the final lesson in our Data Cleaning module. In our previous session, you learned how to standardize the format of your data, ensuring consistency across text, dates, and numbers. Having mastered how to structure and format your data, we will now address one of the most common challenges in any dataset: what to do when data is missing.

This lesson focuses on identifying and handling missing values. For a freelance data researcher, delivering a "complete" dataset is a key measure of quality. Blank cells can break formulas, skew analytical results, and make a dataset difficult to use. You will learn several practical, professional methods in both Excel and Google Sheets to manage these gaps, ensuring your final product is robust and reliable.


The Problem with Blank Cells

Before we learn how to fix missing values, it's crucial to understand why they are a problem. A blank cell doesn't mean the value is zero; it means the value is unknown or not applicable. Treating these blanks as zeros can lead to significant errors in your analysis.

For instance, if you are calculating the average price of a list of products and some prices are missing, including them as zeros in your calculation will incorrectly lower the average.

Blank Cells in Google Sheets? || If Cell is Blank Return Value or Blank

The video "Blank Cells in Google Sheets?" by Aki Stepinska provides an excellent explanation of this concept.

Watch the segment from 00:06 to 01:33. The speaker clearly demonstrates why an empty cell should not be treated as a zero, as it can distort your analysis, such as when calculating an average. This is a fundamental concept for producing accurate results.


Method 1: Finding and Filling All Blank Cells

The most direct way to handle multiple missing values is to select all of them at once and decide on a single action. Both Excel and Google Sheets have a powerful feature called "Go To Special" that makes this easy.

How to Clean Data in Excel: A Beginner's Guide

This guide from DataCamp offers a clear, step-by-step process for selecting all blank cells within a data range.

Read the section titled "Select and treat all blank cells". Focus on the instructions for using the Go To dialog box, which you can open with the shortcut Ctrl + G (or Fn + Ctrl + G on some laptops). The key steps are selecting your data range, opening Go To Special, choosing Blanks, and then entering your desired value.

The "Go To Special" dialog box in Excel, where you can select all blank cells in your chosen range.

Once all blank cells are selected, you have several strategic options. The two most common are:

  1. Fill with a constant value: Replace blanks with a placeholder like "N/A" (Not Applicable), "TBD" (To Be Determined), or "Missing." This makes it clear that the data is intentionally absent.
  2. Fill with the value from the cell above: This is useful for poorly formatted reports where a value in one row is meant to apply to several subsequent blank rows.

The following video demonstrates both of these techniques in action.

How to Clean Data in Excel in 10 Minutes (Free File)

The video "How to Clean Data in Excel in 10 Minutes" from MyOnlineTrainingHub provides a perfect demonstration of these strategies. The process shown is very similar in Google Sheets.

Watch from 02:41 to 03:34. The presenter first shows how to enter a placeholder ("TBA") and apply it to all selected blank cells using Ctrl + Enter. Then, they demonstrate how to enter a formula pointing to the cell above (=A2, for example) and use Ctrl + Enter to propagate the values downward.


Method 2: Handling Missing Data Within Formulas

Sometimes, you don't want to change the original data. Instead, you want your formulas to be smart enough to ignore blank cells and avoid producing errors.

Using IF and ISBLANK

A clean and robust way to write formulas is to first check if a cell is empty. The ISBLANK function returns TRUE if a cell is empty and FALSE otherwise. You can combine this with an IF statement to control your calculation.

The logic is: IF( a cell is blank, return a blank, otherwise, perform the calculation ).

Blank Cells in Google Sheets? || If Cell is Blank Return Value or Blank

Let's return to the "Blank Cells in Google Sheets?" video to see how to build this type of formula.

Watch the segment from 03:29 to 04:50. The instructor wraps a calculation within an IF(ISBLANK(...)) formula. This approach prevents errors from appearing in your calculated column and keeps your dataset tidy. A sample formula looks like this: =IF(ISBLANK(B2), "", B2*C2).

Using IFERROR

Another common scenario is when a calculation results in an error because it involves a blank cell (e.g., trying to multiply a number by an empty cell). This often produces an ugly #VALUE! error. The IFERROR function provides an elegant solution.

The logic is: IFERROR( attempt this calculation, if it results in an error, do this instead ).

How to Clean Data in Excel in 10 Minutes (Free File)

Now, let's look at the IFERROR function, which is a great tool for catching and replacing formula errors.

Watch from 06:45 to 08:04. A sales calculation fails because the price per unit is missing. The presenter wraps the original formula in IFERROR. For example, IFERROR(G2*H2, "") will attempt to multiply the cells, but if it fails, it will return a blank instead of an error message.


Method 3: Standardizing Non-Blank Placeholders

Finally, you may encounter datasets where missing values are not blank but are represented by inconsistent text like "null," "n/a," "missing," or even "?". In this case, your goal is to standardize them. The Find and Replace tool (Ctrl + H), which you've used before, is perfect for this.

You can search for each variation (e.g., "null") and replace it with a standard placeholder (like "N/A") or with a truly blank cell by leaving the "Replace with" field empty.

The Find and Replace dialog is ideal for standardizing various placeholders for missing data, such as replacing them all with a blank or a consistent term like "N/A."

Conclusion

This lesson concludes our module on Data Cleaning and Preparation. You are now equipped with a comprehensive set of skills to transform raw, messy data into a clean, structured, and reliable asset—a critical capability for any data professional.

Here are your key takeaways for handling missing values:

  • Acknowledge the Issue: Blank cells are not zeros; they represent unknown information and must be handled carefully to avoid corrupting your analysis.
  • Bulk Actions: Use Go To Special > Blanks to quickly select all empty cells and either fill them with a placeholder (like "N/A") or propagate values from rows above.
  • Robust Formulas: Use IF(ISBLANK(...)) to prevent formulas from calculating on empty cells, or use IFERROR(...) to gracefully manage errors that arise from missing data.
  • Standardize Placeholders: Use Find and Replace to unify inconsistent textual representations of missing data into a single, standard format or to remove them entirely.

In our next module, Market Research Application, we will shift gears. You will start applying your data collection and cleaning skills to practical research tasks, beginning with how to identify relevant online sources for an industry research project.