Advanced Dynamic Filtering with CHECKBOXES in Excel
2K views
Jan 29, 2024
This video shows how to use the #new #checkbox in Excel to control selection of columns from advanced dynamic filtering.
View Video Transcript
0:00
Hi, in this video I'm gonna show you how to perform advanced dynamic filter with
0:08
checkboxes in Excel. The checkboxes is located in the Insert tab of the ribbon
0:15
and it allows us to display and edit true and false values. So I'm gonna see
0:22
how we can use them in our formula to perform advanced calculation. Enough of
0:27
talking, let's get started. Now I'm gonna be playing around with this sample sales
0:32
data set and of course the data is officially stored in an Excel table. I
0:37
can double check in the table design contextual ribbon tab and I can see data
0:42
as the table name. And of course we want to perform or go through these criteria
0:49
We want to filter this data set to display the records for the account
0:55
manager named Tina John and Conor Rolibet with customer type segments that
1:01
equal to small business and home office with total sales that is greater than or
1:07
equal to 3,000. I'm gonna show you how we perform dynamic selection of column
1:13
based on filtered results in the past and then I'm gonna show you the modern
1:17
way to do that with the new checkboxes. So let's say I'm gonna come to cell I5
1:23
and type in the filter. Now the first argument of the filter is the array so
1:28
I'm gonna select the entire data set from the top here excluding the headings
1:32
put in a comma. Now for the include argument since we want to perform the
1:37
records for account manager that equal to Tina John and Conor Rolibet, I'm gonna
1:44
open two brackets. So for the first one I'm gonna come to column C and check the
1:49
account manager are you equal to Tina John in I2. Close the brackets. Now this
1:55
is gonna be a logical operation so I'm gonna use the plus math operator open
2:01
the second bracket again account manager the main site are you equal to Conor
2:06
Rolibet in cell J2. Close the two brackets for now. Close the filter. Let's
2:10
see what this is delivering. When I hit control enter, there we go. So we can see
2:16
this return all the columns and of course you see the account manager equal
2:22
to Conor Rolibet and Tina John. Lovely. Let's undo this customer type that equal
2:28
to small business and home office. So double click in the top cell and of
2:36
course I'm gonna get rid of the closing brackets and I'm gonna use the
2:40
multiplication. This is gonna be and logical operation. So two opening brackets again I want to check the customer type in column B are you equal
2:51
to small business in K2. Close the brackets and then for the R I'm gonna
2:57
use the plus sign open that in the bracket and again the customer type in
3:02
column D are you equal to the home office. So close the two brackets and
3:07
then I can close the filter for now and let's double click or click control
3:12
enter and there we go. So this return the account manager for Tina John and Conor
3:19
Rolibet and of course for the customer type we have the small business and home
3:24
office. This is fine. Now let's undo the last criteria which is the total that is
3:29
greater than or equal to 3,000. So double click in the top cell again I'm gonna
3:34
delete the closing brackets and again multiplication sign to perform the and
3:38
open the bracket and then we'll check the total in column G. Are you greater
3:43
than or equal to 3,000. Close the bracket for the total column and then close the
3:49
bracket for the filter. Control enter. There we go. You can see these are all the
3:55
records that satisfied the criteria we specified and of course you can see we
4:00
have 11 count of transaction. Now this actually return all the columns but we
4:06
want to return the specific three columns the customer type, product name
4:10
and the total. So I'm gonna come to the top cell. Now this is what I do in the
4:14
past. I'm gonna nest another filter outside and it's gonna be the input value for the
4:20
array argument of the outermost filter and then I'm gonna put in a comma. Now
4:25
for the include I'm gonna use the count ifs or the count if. Now for the count ifs
4:31
I'm gonna provide the criteria range one. It's gonna be the unique columns that I
4:37
want to return. Put in a comma. Now for the criteria one, it's gonna be the
4:42
original column from the data set. So you can close off the count ifs and then I
4:48
can check what this is delivering. It's gonna return 0 1 0 1 and so on and so
4:53
forth. 0 simply means hey don't give me that column. 1 simply means hey return the
4:57
column in your final result. So I can close off the outermost filter and
5:02
control enter. There we go. So we can see the customer type, the product name and
5:09
the total. Now the amazing part of this calculation is that when I change this
5:13
to account manager, I want to change the product name to account manager. There
5:18
we go. It's dynamically updated. This is cool. Now we want to see how we can use the new
5:24
checkboxes to control the filter. So I'm gonna come to the top cell here. This
5:30
very include arguments. So I'm gonna grab this and replace with the checkboxes in
5:37
row number three. That's cool. When I hit enter, it's gonna return a calc because of
5:43
course no particular checkbox is already checked. But when I check this product
5:48
name, there we go. We have the product names. Now I'm gonna uncheck that and we have the calc
5:54
So we can actually treat the calc error nicely. So I'm gonna come to the last
5:58
argument of the filter, the if empty. So I can actually use the double quote to give
6:03
me empty string. So when I control enter again, we've got this return to nothing. I'm
6:08
gonna delete this or clear all this labels or the headings. So let's clear
6:12
all and this is where the formula is. Double click. Now that's what I'm gonna
6:17
do. I'm gonna use this calculation in my let formula. So let's continue in
6:24
formula bar. So I'm gonna come to the formula bar and alt enter and I'm gonna press
6:28
control shift u to expand the formula bar. So I think let's just indent this to
6:33
make it a little bit readable. Control or alt enter. I'm gonna come here. Let's just
6:39
press alt enter. I think this is more better. So I'm gonna use the let function
6:45
which allows us to assign calculations to names. So for the first argument, the
6:53
name one, I'm gonna call this one filtered results. Just a label, a name and
6:59
it's gonna govern the name value of this calculation. Lovely. Let's just check
7:05
around. I'm gonna put in a comma. Now for the temporary calculation, you can
7:09
actually call the name one which is filtered result. I can close up the
7:13
bracket and I hit enter. This returns nothing again because no checkbox has
7:19
been checked. When I check account manager, of course this returns the account manager's name
7:23
based on this criteria. I'm gonna clear the checkbox. I'm gonna come to the cell
7:27
Okay, the cell. Now this is what I'm gonna do. I'm gonna come back to the let and
7:32
this is gonna be the name one. I'm gonna press alt enter. So let's create a new name one
7:38
I'm gonna call this one put in a comma. Now put in another comma. So carefully
7:43
come inside this name value one. In this case, I'm gonna use the filter function
7:49
because I want to return all these original headers and for the include
7:56
argument, I want to return all the checkboxes in row number three. That's
8:00
fine and then don't forget to close off the filter and there we go. Now let's just
8:06
check around. Let me check this. Let's just evaluate this header name. So
8:10
I'm gonna delete this and type in the header. Call it. When I hit control enter, of course this
8:16
returns an error. So what I'm gonna do is I'm just gonna come back to the same
8:20
filter that we just created. Put in a comma. So if empty, we want to return an
8:26
empty string. Control enter. That's lovely. Okay so I'm gonna double click. Now let's
8:33
continue in the formula bar. I'm gonna press alt enter to move the formula down
8:38
So I'm gonna get rid of these. Delete. Backspace. Okay I'm gonna press alt enter
8:44
again to jump to the next line. Now this is what I intend to do. I actually want to
8:48
stack them vertically using the VStack function. So for the name three, I'm
8:55
gonna call this one calc. Put in a comma. For the name value three, I'm gonna use
8:59
the VStack function which vertically stacks array into an array. So press the
9:06
start key. So for the first argument, I want to actually stack this header. So I'm
9:10
gonna call that header. Put in a comma. And then for the array two, I'm gonna call
9:15
the filtered result. I can close up the brackets and then I can put in a comma
9:20
Now for the final calculation, I'm gonna just call this calc name that we defined
9:25
So calc and close the brackets. Fold the legs. Now this is the moment of truth
9:31
When I hit control enter, this will return nothing. Fine. Now let's see use the check
9:38
boxes to control the results. So when I check account manager first, I can see
9:42
hey we have the list of account managers name and the heading. Lovely. So let's say I
9:47
want to check the total. So just click on the total in column G and there we go. So we
9:51
can see the total column and the account manager. Now let's include the customer
9:56
type. Now the customer type is actually coming before the account manager. So
10:00
when I check this customer type, there we go. You're gonna see the customer type first
10:04
then the account manager, and then we have the total. Let's say I want to include the
10:10
product with the check box. There we go. We have the product name. Let's say I want to
10:15
include the unit. That's it. Lovely. And I can even uncheck. So when I uncheck
10:20
product, there we go. It's gone. When I uncheck the account manager, it's gone. I can
10:26
even add the other date. There we go. So you can see the other date, customer type
10:29
unit, total. So this is basically how we can use the amazing check boxes to
10:37
control the columns we want to return based on our field tag result. I hope you
10:43
enjoyed this video. If you do, like it, share with your friends, and comment. Thank you
10:48
and bye for now. Cheers