SUBTOTAL vs AGGREGATE — The Totals That Follow the Filter, and When to Use Each
A plain SUM counts rows the filter just hid, which is why a filtered list so often shows a total nobody asked for. SUBTOTAL is the Excel answer, and AGGREGATE is its superset — it can also step over the one