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 Expert Prashanth KV is a Diamond Product Expert in Google Sheets, officially recognized by Google for his contributions to the Docs Editors Help Community and featured in the Google Product Experts Directory. Explore his blog to learn advanced formulas, automation tips, and problem-solving techniques to elevate your spreadsheet skills.

Calculate Trip Days by Month (Start, End, and Full Days) in Google Sheets

If you're managing business travel in Google Sheets, you may need to calculate how...

Mode of Comma-Separated Numbers in Excel (Dynamic Array)

There is no dedicated function in Excel to directly find the mode of comma-separated...

How to Find Mode of Comma-Separated Numbers in Google Sheets

Working with comma-separated numbers inside a single cell is a common scenario in Google...

How to Count Merged Cells in Google Sheets (and Get Their Size)

Sometimes, you may have blocks of merged cells in a column or row. But...

More like this

Mode of Comma-Separated Numbers in Excel (Dynamic Array)

There is no dedicated function in Excel to directly find the mode of comma-separated...

Sort Each Row Individually in Excel Using a LAMBDA Formula

Sorting rows in Excel typically refers to rearranging entire datasets based on values in...

Sort by Field Labels Using the SORT and XMATCH Combo in Excel

Want to sort your Excel data by column names instead of column positions? Learn...

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.