Formula Errors

How to Return Nonblank Values Without Gaps in WPS Office Excel

Maira MehtabMaira Mehtab Nov 13, 2026 869 views

Question details

The user needs a formula in WPS Office Spreadsheets that takes a column with empty cells and returns only the nonblank values consecutively in another column, optionally sorted.

How to Return Nonblank Values Without Gaps in WPS Office Spreadsheets
Product
WPS Office Spreadsheets
Device & OS
not provided
Scenario
The user is creating a compact list from a source column that includes blank cells and wants to avoid gaps in the output; sorting the resulting values numerically is also mentioned.
Observed behavior
A typical formula copied down returns blank cells for blank source rows, leaving gaps in the output list.
Before you start

Open the workbook in WPS Office Spreadsheets and identify the source column and the first output cell. If you plan to sort the result, keep the output in a separate column so the source data remains unchanged.

Solution 1Recommended

Use the FILTER Dynamic Array Formula in WPS Office Spreadsheets

Use this method when your WPS Office version supports dynamic arrays and you want a single formula that automatically spills all nonblank values into a compact list.

The FILTER function tests every cell in the source range and returns only the cells that meet the condition, so empty cells are skipped without dragging a formula down.

1
Select the first output cell

Click the cell where the compact list should start, such as C1.

2
Enter the FILTER formula

Type =FILTER(A:A,A:A<>"") and press Enter. WPS Office will spill all nonblank values from column A into C1 and down.

3
Use a fixed range if preferred

To avoid processing the entire column, replace A:A with a fixed range such as A1:A100, for example =FILTER(A1:A100,A1:A100<>"").

Use the FILTER Dynamic Array Formula in WPS Office Spreadsheets
Result: Blank source cells are skipped, and the nonblank values appear consecutively without gaps in the output column.

Create a Gap-Free Nonblank List in WPS Office Spreadsheets

WPS Office Spreadsheets makes it easy to extract only the nonblank values from a column and place them in a continuous list. The formulas work with common XLSX files and give you a lightweight, free alternative for handling Excel formula tasks.

  1. 1. Open the workbook in WPS Office Spreadsheets: Launch WPS Office, click Open, and select the workbook that contains the source column with blank cells.
  2. 2. Click the first output cell: Select the cell where you want the compact nonblank list to begin, such as C1.
  3. 3. Enter the nonblank extraction formula: Type =FILTER(A:A,A:A<>"") and press Enter. If your version does not support FILTER, use the AGGREGATE formula shown above.
  4. 4. Copy or sort the returned values: If you need a static list, copy the returned values and paste them as values. To reorder them, select the output column and click Data > Sort.
Skip blank cells automatically with dynamic array or AGGREGATE formulasCreate a compact, sorted list without manually filtering and copying dataWorks with Microsoft Excel .xlsx files and preserves formula compatibilityFree to use with an intuitive spreadsheet interface similar to Microsoft Excel
QA img-9

Frequently Asked Questions

Does WPS Office support the FILTER function?

Recent versions of WPS Office Spreadsheets support FILTER. If the formula is not available, you can open the workbook and use the AGGREGATE-based formula described in this article to achieve the same nonblank list.

How can I return nonblank values in sorted order without gaps?

Extract the values first with =FILTER(A:A,A:A<>"") or the AGGREGATE formula, then select the output column, go to the Data tab, click Sort, and choose Smallest to Largest.

Why does my formula return 0 or a blank when copied down?

Make sure the IFERROR final argument is "" so no values are displayed for non-matching rows, and check that the source range and output column references are correct. If you use legacy array formulas, press Ctrl+Shift+Enter.

Can I extract nonblank values from a range with multiple columns?

FILTER can return multiple columns, but the compact column list method in this article is designed for a single source column. For multiple columns, use FILTER with a condition such as =FILTER(A1:B100,(A1:A100<>"")*(B1:B100<>"")).

How do I avoid a #SPILL error in WPS Office Spreadsheets?

Clear the cells directly below the formula cell because the spill range must be empty. If you need the list somewhere else, move the formula to a cell with enough blank cells below it.