# SUBTOTAL

Spread for WinForms provides advanced software components that support Excel import/export, full cell customization, an extensive calculation engine with over 450 functions and more, all with zero dependencies on Excel.

## Content



This function calculates a subtotal of a list of numbers using a specified built-in function.

## Syntax

SUBTOTAL(*functioncode*,*value1*,*value2*,...)
SUBTOTAL(*functioncode*,*array*)

## Arguments

The *functioncode* argument is the number that represents the built-in function to use for the subtotal, as given in this table.

| **Built-In Function** | **Function Code (Include Hidden Values)** | **Function Code (Ignore Hidden Values)** |
| ----------------- | ------------------------------------- | ------------------------------------ |
| [AVERAGE](/spreadnet/docs/latest/online-formula/formulas-functionsall/formulas-functsAtoC/FunctionAVERAGE) | 1 | 101 |
| [COUNT](/spreadnet/docs/latest/online-formula/formulas-functionsall/formulas-functsAtoC/FunctionCOUNT) | 2 | 102 |
| [COUNTA](/spreadnet/docs/latest/online-formula/formulas-functionsall/formulas-functsAtoC/FunctionCOUNTA) | 3 | 103 |
| [MAX](/spreadnet/docs/latest/online-formula/formulas-functionsall/formulas-functsMtoQ/FunctionMAX) | 4 | 104 |
| [MIN](/spreadnet/docs/latest/online-formula/formulas-functionsall/formulas-functsMtoQ/FunctionMIN) | 5 | 105 |
| [PRODUCT](/spreadnet/docs/latest/online-formula/formulas-functionsall/formulas-functsMtoQ/FunctionPRODUCT) | 6 | 106 |
| [STDEV](/spreadnet/docs/latest/online-formula/formulas-functionsall/formulas-functsRtoS/FunctionSTDEV) | 7 | 107 |
| [STDEVP](/spreadnet/docs/latest/online-formula/formulas-functionsall/formulas-functsRtoS/FunctionSTDEVP) | 8 | 108 |
| [SUM](/spreadnet/docs/latest/online-formula/formulas-functionsall/formulas-functsRtoS/FunctionSUM) | 9 | 109 |
| [VAR](/spreadnet/docs/latest/online-formula/formulas-functionsall/formulas-functsTtoZ/FunctionVAR) | 10 | 110 |
| [VARP](/spreadnet/docs/latest/online-formula/formulas-functionsall/formulas-functsTtoZ/FunctionVARP) | 11 | 111 |

Each additional argument can be a double-precision floating-point value, an integer value, or an array (cell range) of these. Up to 255 arguments can be included. You can use a single array (cell range) instead of a list of values. You can use multiple arrays (cell ranges) as well.

## Remarks

The SUBTOTAL function does not include other SUBTOTAL formula results that are in the same range.

## Data Types

Accepts numeric data for all arguments. Returns numeric data.

## Examples

`SUBTOTAL(8,A1:B7)`

## Version Available

This function is available in product version 2.0 or later.

## See Also

[SUMPRODUCT](/spreadnet/docs/latest/online-formula/formulas-functionsall/formulas-functsRtoS/FunctionSUMPRODUCT) \| [SUM](/spreadnet/docs/latest/online-formula/formulas-functionsall/formulas-functsRtoS/FunctionSUM) \| [Math and Trigonometry Functions](/spreadnet/docs/latest/online-formula/formulas-overview/formulas-functs/formulas-functtypes/formulas-functsmathtrig)