Contact

SUBTOTAL Function in WPS Spreadsheet: Syntax, Examples and Compatibility

Math Beginner WPS Spreadsheet

Use SUBTOTAL in WPS Spreadsheet to summarize a filtered list while controlling treatment of hidden rows. Two original examples, expected results, cautions and official software documentation.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: SUBTOTAL summarizes a vertical list using a function code. Codes 9 and 109 both request a sum, but 109 additionally excludes manually hidden rows. Rows excluded by a filter are ignored with either code, according to the dated WPS reference.

Availability and version history

  • Introduced: documented by 2019-05-14 in the official WPS lesson; original introduction is not established.
  • Availability: WPS Office for Windows Personal; no numeric release is stated. This documents the named edition rather than a particular installed build.
  • Scope: current supported build limits remain unverified. The Windows lesson does not establish equivalent support in other WPS clients.
  • Checked: October 14, 2026. Function-specific documentation and independent calculations; no new native WPS test was performed.

Syntax and arguments

=SUBTOTAL(function_num,ref1,[ref2],...)

function_num selects the calculation and manual-hidden-row policy; ref1 is the first range or reference. The historical Windows Personal lesson describes 1–29 references. That is a dated documentation limit, not a verified current-build maximum.

Square brackets mark optional arguments and are not typed. Examples use English function names and comma separators; adapt punctuation to the workbook locale without changing quoted comparison text.

Prepare the original example

Enter numeric 10, 20, 30 and 40 in B2:B5. Leave all rows visible and unfiltered for the two original controls. Put their formulas outside the source range.

Example 1: original control

=SUBTOTAL(9,B2:B5)

Expected output: 100. Sum over four visible rows is 10 + 20 + 30 + 40.

Example 2: original comparison

=SUBTOTAL(1,B2:B5)

Expected output: 25. Average over the same four values is 100 divided by 4.

Select the code deliberately

The official lesson’s code table identifies these useful pairs:

Calculation Include manually hidden rows Exclude manually hidden rows
AVERAGE 1 101
COUNT 2 102
COUNTA 3 103
MAX 4 104
MIN 5 105
PRODUCT 6 106
SUM 9 109

Both code families ignore rows removed by filtering. The table controls which calculation is requested; it does not change that calculation’s underlying interpretation of numbers, text or errors into one universal rule.

Example 3: compare manually hidden rows

Start with all four original rows visible. Hide the entire worksheet row containing 20, then compare:

=SUBTOTAL(9,B2:B5)
=SUBTOTAL(109,B2:B5)

Expected results: 100 and 80. Code 9 includes the manually hidden 20; code 109 excludes it. Hiding a column containing horizontally arranged values is a different operation and is not a substitute for hiding a row in this example.

Restore the row before the next experiment. These are independently calculated expectations from the documented visibility rules; no native WPS hide/filter test was performed for this article.

Example 4: compare filtering with manual hiding

Add a heading in B1 and apply a filter to the list so the value 30 is excluded. Leave every other row manually unhidden.

The two formulas above now both have expected result 70, from 10+20+40. A 1–11 code includes manually hidden rows, but it does not include rows excluded by the filter.

Keep that filter active and additionally hide the row containing 20 manually. Expected results become 70 for code 9 and 50 for code 109. The filter removes 30 for both; manual hiding removes another 20 only for 109. Restore all rows and clear the filter when the experiment is finished.

Advanced example: visibility changes an average’s denominator

With all original rows restored, codes 1 and 101 both return 25. Now manually hide only the row containing 20:

=SUBTOTAL(1,B2:B5)
=SUBTOTAL(101,B2:B5)

Expected results are 25 and 80/3, approximately 26.666666667. The visible-only average divides the remaining total by three numeric observations; it does not divide by the original four rows.

As a separate experiment, restore that row and filter out only 30. Both average codes then have expected result 70/3, approximately 23.333333333. Keep the visibility state explicit when comparing two displayed averages.

Advanced example: avoid counting a nested subtotal twice

Clear the filter and show all rows. In B6 enter =SUBTOTAL(9,B2:B5), giving 100. In another cell outside B2:B6 enter:

=SUBTOTAL(9,B2:B6)

Expected result: 100, because the documented rule excludes nested SUBTOTAL results from the referenced cells. An ordinary =SUM(B2:B6) instead has expected result 200 with all rows visible: it adds the four source values and the calculated 100.

Keep B6 as the actual SUBTOTAL formula for this control. Replacing it with a pasted numeric 100 loses the formula identity on which the nested-subtotal rule depends. Do not infer that any unrelated formula or manually typed summary is automatically excluded.

Troubleshooting and limits

Use vertical ranges and record whether rows were filtered out or manually hidden. The lesson explicitly notes that hiding a column in a horizontal reference does not give the same exclusion behavior. It also documents #VALUE! for three-dimensional references; ordinary single-sheet ranges avoid that restriction.

Inspect the function code before changing a correct formula to compensate for an unexpected visibility state. For condition-based selection rather than visibility, use SUMIF or SUMIFS.

Current-build reference limits, imported hidden-row metadata and every underlying aggregation’s type/error policy have not been verified. The original controls and all numeric visibility examples here are independent models of the dated product documentation.

Each comparison guide is researched separately; a shared function name does not establish identical platform availability or edge behavior.

Evidence level: The complete article was reviewed against the direct WPS lesson. Original worked formulas, title and publication date are preserved. Added outputs are independently calculated expectations, not native WPS test results.