Function Problems

WPS Spreadsheets: Fill Blank Cells Down and Up with LAMBDA and SCAN

Natalie TaylorNatalie Taylor Nov 12, 2026 869 views

Question details

The user needs a dynamic-array formula that fills blank cells with nearby nonblank values across one or more columns.

WPS Spreadsheets: Fill Blank Cells Down and Up with LAMBDA and SCAN
Product
WPS Spreadsheets
Device & OS
not provided
Scenario
A worksheet contains blank cells that should inherit the most recent nonblank value, similar to Power Query Fill Down or Fill Up.
Observed behavior
Blank cells remain empty until a LAMBDA and SCAN formula is applied to propagate values through the selected data range.
Before you start

Confirm that your WPS Spreadsheets version supports dynamic-array functions such as LET, LAMBDA, SCAN, and, where available, BYCOL. Identify the source range and decide whether blank cells should inherit the previous value, the next value, or both.

Solution 1Recommended

Fill blanks down in one column with LET and SCAN

Use this formula when each blank cell should receive the most recent nonblank value above it in a single column.

The formula initializes SCAN with the first nonblank value in the range, then replaces each blank with the previous accumulated value. Existing nonblank values remain unchanged.

1
Select the output cell

Click the first cell where you want the filled results to appear, such as B2, leaving the original source range in column A unchanged.

2
Enter the fill-down formula

Enter =LET(initial,TAKE(TOCOL(A2:A100,3),1),SCAN(initial,A2:A100,LAMBDA(previous,current,IF(current="",previous,current)))) and press Enter.

3
Review the spilled results

Check the spilled array below the formula cell. Blank entries in A2:A100 should display the most recent nonblank value above them.

Range adjustment: Replace A2:A100 with your actual source range. If the range begins with blanks, the formula uses the first nonblank value found by TOCOL.

Fill Blank Cells Across Columns with WPS Spreadsheets Formulas

WPS Spreadsheets can complete this workflow with LET, LAMBDA, SCAN, and supported dynamic-array functions. Create a single-column fill function, apply it to your data range, and keep the results compatible with common Excel workbook formats.

  1. 1. Open the workbook: Launch WPS Office, choose Spreadsheets, and open the workbook containing the blank cells.
  2. 2. Check formula support: Select an empty cell and test a supported function such as =LET(x,1,x). Confirm that the formula calculates before building the full solution.
  3. 3. Enter the fill-down formula: Click the output cell and enter =LET(initial,TAKE(TOCOL(A2:A100,3),1),SCAN(initial,A2:A100,LAMBDA(previous,current,IF(current="",previous,current)))).
  4. 4. Apply the logic to multiple columns: For supported versions, enter =BYCOL(A2:D100,LAMBDA(column,LET(initial,TAKE(TOCOL(column,3),1),SCAN(initial,column,LAMBDA(previous,current,IF(current="",previous,current)))))) in the output area.
Fill blank cells from the most recent nonblank value without manually editing each row.Use reusable LAMBDA logic for repeated data-cleaning tasks across multiple columns.Open and save common Microsoft Excel .xlsx and .xls workbooks with familiar spreadsheet controls.Work in a lightweight spreadsheet interface with formula editing, spill ranges, and Paste Special tools.
microsoft office alternative - wps office

Frequently Asked Questions

How do I fill blank cells with the previous value in WPS Spreadsheets?

Select an output cell and enter =LET(initial,TAKE(TOCOL(A2:A100,3),1),SCAN(initial,A2:A100,LAMBDA(previous,current,IF(current="",previous,current)))). Change A2:A100 to your source range.

Can I fill blanks across several columns at once?

If your WPS version supports BYCOL and dynamic arrays, apply the single-column logic with =BYCOL(A2:D100,FILLDOWN), where FILLDOWN is the reusable LAMBDA. Otherwise, enter the single-column formula separately for each column.

What does SCAN do in the fill-down formula?

SCAN processes the range sequentially and carries forward an accumulated value. The LAMBDA keeps the current cell when it is nonblank and uses the previous accumulated value when the current cell is blank.

How can I fill blanks upward instead of downward?

Reverse the range, apply the fill-down logic, and reverse the result again. In practice, a formula using SORTBY or an equivalent reverse-order method can perform the upward pass before restoring the original row order.

Why does my WPS formula return an unsupported-function error?

Your WPS version may not support LET, LAMBDA, SCAN, TOCOL, or BYCOL. Use the helper-column method with =IF(A2<>"",A2,B1), copy it down, and paste the results as values.