Calculation Issues

How to Sum Filtered or Noncontiguous Cells in WPS Spreadsheets

Rana GarciaRana Garcia Nov 13, 2026 869 views

Question details

The user needs a spreadsheet total that includes only currently filtered or noncontiguous cells, excluding hidden rows that a normal SUM range would include.

How to Sum Filtered or Noncontiguous Cells in WPS Spreadsheets
Product
WPS Spreadsheets
Device & OS
not provided
Scenario
Calculating totals after applying an AutoFilter or selecting nonadjacent cells in a worksheet.
Observed behavior
A standard SUM formula includes hidden or unintended cells when the filter changes, so the total does not match the visible rows.
Before you start

Open the workbook in WPS Spreadsheets and confirm whether the data uses AutoFilter, manual hidden rows, or a one-time nonadjacent selection. This determines whether SUBTOTAL, AGGREGATE, or a manual SUM formula is the best fit.

Solution 1Recommended

Use SUBTOTAL to sum visible cells after filtering

Use this solution when you need the total to update automatically as you change AutoFilter criteria.

SUBTOTAL is the safest built-in way to total only rows currently visible in a filtered list. Function number 9 sums, and the function automatically excludes rows hidden by an AutoFilter.

1
Select the result cell

Click the cell where the total should appear, for example F2, in your WPS Spreadsheets worksheet.

2
Open AutoFilter if not already active

Select your data range, click Home > AutoFilter, and choose a filter value from a column header.

3
Enter the SUBTOTAL formula

Type =SUBTOTAL(9,A2:A100) in the result cell and press Enter. Replace A2:A100 with your actual data range.

4
Verify with different filters

Change the filter criteria and confirm that the total recalculates using only visible rows.

Use SUBTOTAL to sum visible cells after filtering
Filtered totals update automatically: Use function number 9 for AutoFilter-visible totals, or 109 if you also need to ignore manually hidden rows.
WPS Spreadsheets formula tutorial

Sum Filtered and Noncontiguous Ranges in WPS Spreadsheets

Use WPS Spreadsheets' built-in SUBTOTAL and AGGREGATE functions to total visible rows or nonadjacent selections. WPS Office opens and saves Microsoft Excel .xlsx and .xls files, so you can work with the same formulas and formatting in a free, lightweight suite.

  1. 1. Open your workbook: Launch WPS Spreadsheets and open the .xlsx or .xls file containing the data you need to sum.
  2. 2. Select the result cell: Click the cell where the total should appear, such as below the filtered column.
  3. 3. Enter a visible-cell total formula: Type =SUBTOTAL(9,A2:A100) or =AGGREGATE(9,7,A2:A100) and press Enter.
  4. 4. Apply filters or select noncontiguous cells: Use Home > AutoFilter to filter the list, or start =SUM( and hold Ctrl to select nonadjacent ranges.
  5. 5. Save your workbook: Click File > Save As and keep the Excel-compatible .xlsx format if you need to share it with Microsoft Excel users.
Totals automatically update only for visible filtered rowsSupports noncontiguous SUM selections without macrosFull compatibility with Microsoft Excel .xlsx and .xls formatsFamiliar spreadsheet functions such as SUBTOTAL, AGGREGATE, and SUMFree download with a lightweight, easy-to-use Office interface
microsoft office alternative - wps office

Frequently Asked Questions

Why does my SUM formula include hidden rows after I filter data?

Because SUM adds every cell in the referenced range regardless of visibility. Use =SUBTOTAL(9,A2:A100) to sum only rows visible after an AutoFilter, or =SUBTOTAL(109,A2:A100) to also exclude manually hidden rows.

How do I sum only visible cells after filtering in WPS Spreadsheets?

Click the result cell, type =SUBTOTAL(9,A2:A100), and press Enter. The formula recalculates whenever you change the AutoFilter.

Can I sum nonadjacent cells without writing a VBA macro?

Yes. Click the result cell, type =SUM(, then hold Ctrl and select each cell or range you want to add. WPS Spreadsheets inserts the comma separators automatically.

What is the difference between SUBTOTAL 9 and SUBTOTAL 109?

Function number 9 ignores rows hidden by AutoFilter. Function number 109 additionally ignores rows you hide manually with the Hide command.

Does WPS Spreadsheets support the Excel FILTER function?

Availability may vary by version. For a reliable filtered total, use SUBTOTAL or AGGREGATE instead; they work in WPS Spreadsheets and Excel files.