=SUBTOTAL(function_num,ref1,[ref2],...)
The SUBTOTAL function in Sourcetable can be used with various arguments to return different calculations. For example, the following formula uses the SUM function to return the sum of the visible cells in a range:
=SUBTOTAL(109,range)
To return the count of visible cells in a range, the following formula can be used:
=SUBTOTAL(103,range)
And to return the average of visible cells in a range, the following formula can be used:
=SUBTOTAL(101,range)
In addition, the SUBTOTAL function can be used to only return the calculation for visible cells in the second argument. For example, the following formula uses the COUNT function to return the count of only visible cells in a range:
=SUBTOTAL(3,B7:B19)
And the following formula uses the SUM function to return the sum of only visible cells in a range:
=SUBTOTAL(9,F7:F19)
The SUBTOTAL function is used to return a subtotal of a list or database.