Calculations on a Filtered List in Excel

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. In this blog, learn how to create a dropdown filter in your Excel spreadsheets.

Hi, we are Happy

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

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

Keep informed about happy workplaces

Sign up to Henry's monthly Happy Manifesto newsletter, full of tips and inspiration to help you to create a happy, engaged workplace.

Example of auto-filter

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:

Unfiltered data

And here’s my filtered data:

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:

Filtered subtotal

Related Blogs

Learn the 10 core principles to create a happy and productive workplace in Henry Stewart's book, The Happy Manifesto.

Hi, we are Happy

We help organisations create happy, productive workplaces, where people feel trusted, work to their strengths and are confident with their IT software.

We want everyone to find joy in at least 80% of their work, everyday.

Our workplace solutions include:
– Workplace consultancy
– Leadership and personal development programmes
– Government-funded management apprenticeships
– AI and Excel training

And much more. Get in touch with our friendly team to discuss your current challenge and find out how we can help you.

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.

What you should look at next

Want more ideas for creating happy, productive workplaces?

Sign up for our Happy Manifesto newsletter and discover fresh ways to ignite joy and productivity at work. Get expert tips, insights, and ideas that challenge the norm—straight to your inbox. Join our movement and start your journey for a trust-based, values-led organisation.

Want more ideas for creating happy, productive workplaces?

Sign up for our Happy Manifesto newsletter and discover fresh ways to ignite joy and productivity at work. Get expert tips, insights, and ideas that challenge the norm—straight to your inbox. Join our movement and start your journey for a trust-based, values-led organisation.