Function Problems

Fill Blank Excel Cells with the Previous Value

Steve KSteve K Nov 18, 2026 868 views

Question details

Fill blank cells in imported worksheet data with the most recent nonblank value above them.

Fill Blank Excel Cells with the Previous Value
Product
Microsoft Excel
Device & OS
not provided
Scenario
Data imported from multiple worksheets contains gaps in a column, and the user wants to carry each existing value down through the following blank cells.
Observed behavior
Blank cells should display the nearest preceding nonblank value without inserting new worksheet rows.
Before you start

Identify the column and data range to fill, and make sure the first cell in that range contains a value. For the SCAN method, leave an empty output range outside the source data.

Solution 1Recommended

Use SCAN to carry values down in Excel 365

Use this formula to create a separate result that updates when the source data changes.

1
Choose an output cell

Click an empty cell outside the source range, such as E1 if the source data is in D1:D13. Make sure the cells below it are empty so the results can spill.

2
Enter the formula

In E1, enter =SCAN("",D1:D13,LAMBDA(a,v,IF(v="",a,v))) and press Enter. Adjust D1:D13 to match your source range.

3
Check the results

Review the spilled results in E1:E13. Each blank source value should be replaced in the output by the most recent nonblank value.

Use SCAN to carry values down in Excel 365
The formula does not insert rows: SCAN returns values in existing cells; it does not physically insert worksheet rows or change the source range.
Fill gaps in WPS Spreadsheet

Fill Blank Cells with the Value Above in WPS Spreadsheet

Use Go To Special in WPS Spreadsheet to select empty cells and fill them with references to the values above.

  1. 1. Open the workbook: Open WPS Spreadsheet and choose Open to select your Excel workbook.
  2. 2. Select the range: Select the cells in the column you want to fill, starting with a nonblank cell.
  3. 3. Find the blanks: Press Ctrl+G, choose Special, select Blanks, and confirm.
  4. 4. Fill the selected cells: Type =, press the Up Arrow key, and press Ctrl+Enter. To keep fixed values instead of formulas, copy the filled range and use Paste Special > Values.
Fill gaps in an imported data column without typing each value.Open and edit Microsoft Excel XLS and XLSX files.Use a familiar spreadsheet interface with formula and paste options.
microsoft office alternative - wps office

Frequently Asked Questions

Does the SCAN formula update when the imported data changes?

Yes. The output recalculates when values in the referenced range change. Update the range in the formula if your imported data extends beyond it.

Why does Go To Special miss some cells that look blank?

Those cells may contain formulas that return an empty string. Go To Special > Blanks selects empty cells, not cells containing formulas.

Can a formula insert a new worksheet row?

No. A formula can return values in existing cells but cannot insert rows. To insert one manually, right-click a row number and choose Insert.

How do I remove the fill formulas but keep their results?

Select and copy the filled range, then use Home > Paste > Values in Excel, or Paste Special > Values in WPS Spreadsheet.