Summing with Filters in Excel, Reminding Yourself "Why"

March 7, 2016
Category: TIL
Tags: Apps, Excel, and Philosophy of work

Today I learned:

Summing in Excel with Filters

If you’ve ever tried to write a sum() function in Excel while you have filters on, you likely didn’t get the result you expected. The sum() function adds up what is in the raw cells. It does not take whether or not they’ve been hidden via a filter into account.

subtotal() is the function you are looking for. Specifically, subtotal(9,range). The 9 refers to sum for hidden (not at a result of filtering, though) and non-hidden rows. See the documentation. subtotal() functions only on the results of filtered data.

=SUBTOTAL(9,G1670:G640501) gave me the sum of the the filtered data from G1670 to G640501. (You can see why filtering would be important with such a large data set!)

Remind yourself why

Sometimes I spend too much time and effort trying to convince myself to do something I don’t want to do. This leads to general angst and despair.

My wife reminded me yesterday that the best way of convincing myself is to reflect on why I’m doing it in the first place.

Whatever your reason why is, as long as it outweighs the cost of not doing it, you’ll get over it and find a way. I keep an index card with some why bullet points on it nearby to keep things in perspective.

Find this post useful?

Buy me a coffeeBuy me a coffee