To sum a column use: =SUM(A1:A20). But what if the column is filtered?

As you can see , in the picture below, the sum function sums all the values, even the ones filtered out. To solve this problem use: =SUBTOTAL(9,A1:A20)

Adds all the numbers in a range of cells

Returns a subtotal of a list or database