This is my first blog post of 2017. I have to say I do love the energy of a new year. My favourite time of the year are those days between the “two Christmases” i.e. 25th December and 6th January. There is no pressure. Just movies to be watched, sweets to be eaten, walks to be taken and generally relaxing all around. So I was looking back over my posts and I realised that I had no blog post specifically for filtering – which is probably one of the features you use most in Excel.
In a previous post I have covered how to set up a list and I’ve devoted a big chunk of Chapter Two of my book (Your Excel Survival Kit) to it.
But here I am just going to focus specifically on the mechanics of filtering. So what is filtering? If you have a list in Excel the chances are you are not going to spend your day reading through it from the beginning to the end. If you are, could I suggest that maybe you have just a little too much time on your hands…. No, usually you will need to be able to find specific pieces of information out of it. The best way to do that is via filters. So how do they work?
I am using a file called products_filter which you can download to practise on.
(You can download the file, by doing a right click on it, and then click on Save As, and then choose where you want it saved to)
Let’s say I want to answer 5 questions from this data set.
- How many of the products are Black?
- How many have a List Price over 1000
- How many have a Color of Blue and have Sport in the Product Name
- How many started (ScdStartDate) after 1998 and have a ListPrice between 50 and 100
- How many Product Models have Mountain in the name, have a color of Black or Silver (NOT Black/Silver) and have a list price of over 1000.
In this video I show you how to do these filters, clear down the list after each one and also how you know if there is a filter applied.
Video 1 – How many of the products are Black?
Video 2 – How many have a List Price over 1000
Video 3 – How many have a Color of Blue and have Sport in the ProductName
Video 4 – How many started (ScdStartDate) after 1998 and have a ListPrice between 50 and 100
Video 5 – How many Product Models have Mountain in the name, have a color of Black or Silver (NOT Black/Silver) and have a list price of over 1000.
(Use the same file)
- Identify how many of the products are blue? (28 – check bottom left hand corner)
- Identify how many products have a list price of less than 500 (hint: check number filters for Less than) (202 – again check bottom left hand corner of screen)
- Identify how many products have Road in the ProductName and have a Cost of less than 500 (22 – again check bottom left hand corner)
- Identify how many started in 2007 and 2006 (tick both boxes) and have a Cost between 250 and 500 (50 – again check bottom left hand corner)
- Identify how many products with a product code that starts with FW and a SCDStartDate in 2006 and a list price greater than or equal to 100 (5 – again check answer in bottom right hand corner)