Fill Empty Cells with the Value from Above in Excel

Published on

There are two main approaches to fill empty cells with the value from above in Excel. The first option fills empty cells directly within the source data, while the second approach creates a new dataset with filled cells, leaving the original data unchanged.

Both methods are relatively simple. However, the second option is preferable if you are using an Excel version that supports dynamic arrays.

Example Scenario

Consider the following data in the range A1:C13 in an Excel spreadsheet:

ItemCategoryPrice
AppleFruit1.5
OrangeFruit1.2
BananaFruit1
CarrotVegetable0.8
Tomato1.3
Lettuce1.1
BananaFruit1
1
1
1
TomatoVegetable1.3
Tomato1.3

As you can see, some cells are empty. To fill those empty cells with the values from the cell above, you can use the following methods.

Method 1: The Easiest Way to Fill Empty Cells with the Value from Above

This method directly fills the blanks in the source data.

  1. Select the range A1:C13 where you want to fill the blanks.
  2. Press Ctrl + G to open the Go To dialog box, then click Special. (Alternatively, go to the Home tab, click Find & Select in the Editing group, and select Go to Special.)
  3. In the Go To Special dialog box, select Blanks and click OK.
    Selecting empty cells using the Go To Special dialog box
  4. Now, locate the first blank cell. In our case, it is cell B6.
  5. Type =B5 in the formula bar to refer to the value from the cell directly above.
  6. Press Ctrl + Enter to fill all blank cells in the selected range with the values from the cells above.
Fill empty cells with the value above in Excel using Go To Special

This method quickly fills all empty cells with the value from the cell directly above.

Note: If this returns formulas instead of values, first select the range and apply the General formatting from the Home tab in the Number group

Method 2: Dynamic Formula to Fill Empty Cells Without Altering Source Data

This approach is useful if you want to keep the original dataset unchanged while filling empty cells in a new dataset.

In cell E2 (or a new range where you want the filled data), enter the following dynamic array formula:

=LOOKUP(ROW(A2:A13),ROW(A2:A13)/(A2:A13<>""),A2:A13)

This formula will dynamically fill the empty cells in the range A2:A13 with the values from the cells above.

Drag the fill handle from E2 across columns F and G to apply the formula to the other columns (for Category and Price).

Fill empty cells with the value above in Excel using a dynamic array formula

Formula Breakdown

Let’s understand how this formula works to fill empty cells with the value from above.

Syntax:

LOOKUP(lookup_value, lookup_vector, result_vector)
  • We use ROW(A2:A13) as the lookup_value, which generates a sequence of row numbers (2, 3, … 13).
  • ROW(A2:A13)/(A2:A13<>"") creates an array of row numbers where there are non-blank cells and generates a DIV/0! error in blank rows. This is the lookup_vector.
  • A2:A13 is the result_vector, the range from which we want to return values.
Explanation of lookup_value, lookup_vector, and result_vector in Excel formula

This formula essentially finds the closest previous non-blank cell for each blank cell and returns that value, effectively filling the blank cells with the value from above.

Conclusion

By using either of these two methods, you can efficiently fill empty cells with the value from above in Excel. The first method is quick and straightforward, modifying the original data, while the second method offers a more dynamic approach, leaving the original data unchanged.

Choose the method that best suits your needs depending on whether you want to modify the source data or create a new filled dataset.

Resources

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

Marking Case-Sensitive Unique Values in Excel

Marking case-sensitive unique values provides several benefits compared to merely extracting them in an...

Highlight Upcoming Birthdays in Google Sheets

When highlighting upcoming birthdays in Google Sheets, one important aspect is ignoring the year...

Compare Two Tables for Differences in Excel

To compare two tables with similar data for differences, you can use the XLOOKUP...

Calculate Weighted Average in Pivot Table in Google Sheets

You can calculate a weighted average in a Pivot Table using a custom formula...

More like this

Marking Case-Sensitive Unique Values in Excel

Marking case-sensitive unique values provides several benefits compared to merely extracting them in an...

Compare Two Tables for Differences in Excel

To compare two tables with similar data for differences, you can use the XLOOKUP...

How to Retrieve the Last Record in Each Group in Excel

As part of data analysis, you may need to retrieve the last record from...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.