Excel Blog - Calculations on a Filtered List

In: BlogDate: May 29, 2013By: Darren Andrews

Auto filter is a wonderful thing isn’t it? With a few clicks of the mouse little dropdowns appear letting you filter your data in a myriad different ways.

 

But what if you want to find out the total or average of your filtered data? Unfortunately the SUM, AVERAGE, COUNT, COUNTA etc functions seem to let us down here.

Here’s my unfiltered data and the SUM function in action:

 

And here’s my filtered data:

 

Notice anything different? No? Exactly! We may want the SUM function to only sum the visible data but, as it was designed to do, it will sum ALL of the data, even the hidden rows.

So what’s the answer? The SUBTOTAL function!

The subtotal function can, if we ask it nicely, ignore any values hidden by the autofilter. It looks like this:

=SUBTOTAL(function_num,ref1,[ref2], . . . . ])

The function_num argument tells the subtotal function what sort of calculation you want it to do:


1 AVERAGE
2 COUNT
3 COUNTA
4 MAX
5 MIN
6 PRODUCT
7 STDEV
8 STDEVP
9 SUM
10 VAR
11 VARP

So here’s the same example as above using the subtotal function:

 

Hi, we are Happy

We are leading a movement to create happy, empowered and productive workplaces.

How can we help you and your team to find joy in at least 80% of your work?

More about Happy

 

Why choose Happy?

  • Award-winning learner-focused approach
  • Small class sizes to give personal one-to-one support
  • Two years of free support after your course
  • Private group options available
  • No quibble money-back guarantee on all courses
5 out of 5 stars

Frist and foremost, the teacher was excellent. Furthermore, I found the entire day to be extremely well thought out and carefully constructed. It turned out to be much better than I was expecting. After all - it was a course on Excel training, yet I wasn't bored at all.

Trusted Customer27 days ago

Darren Andrews

Darren is one of Happy's Senior Trainers, able to train almost every IT course on our course programme. He worked for Happy for 12 years and has been an Associate Trainer since 2018.

More by Darren

Want to learn more?

Our Excel Core Level 2 course covers creating formulas using time and time formats, as well as additional time-saving techniques such as conditional formatting, count entries IF they meet a condition and how to create a basic Pivot Table to summarise large sets of data easily. Click here to view our Excel Core Level 2 course outline and see our upcoming public course dates. Contact us for more information and availability.

If you’d like more two minute time saving video tips, you can subscribe to our Happy Video Library from just £40 per year. Visit the Happy Video Library website, or contact us for bulk orders.