Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:05,380 --> 00:00:09,700
In this section of the course, we're going to talk about something that I use all the time, it's one
2
00:00:09,700 --> 00:00:16,990
of my favorite things in Excel and that is data validation and what data validation allows you to do
3
00:00:16,990 --> 00:00:20,920
is basically control what goes into your worksheet.
4
00:00:21,160 --> 00:00:26,380
One of our main goals when we're using Excel is that we want to make sure that the data that goes into
5
00:00:26,380 --> 00:00:30,850
the worksheet is accurate and as error free as possible.
6
00:00:30,940 --> 00:00:36,520
And in this day and age where we have lots of people sharing worksheets that can become quite problematic
7
00:00:36,520 --> 00:00:43,300
if we don't put in some controls and data validation is a great way of controlling what's going into
8
00:00:43,300 --> 00:00:43,780
cells.
9
00:00:44,560 --> 00:00:50,500
So let's take a look at our first example and probably the most common use of data validation.
10
00:00:50,920 --> 00:00:53,740
And that is the data validation dropdown list.
11
00:00:54,430 --> 00:00:57,940
Now we have actually seen this a couple of times throughout this course.
12
00:00:57,940 --> 00:01:03,730
I used it when I was showing you index a match and we're going to do another one of those examples now
13
00:01:03,730 --> 00:01:07,630
so you can see exactly how to create a data validation dropdown list.
14
00:01:08,500 --> 00:01:10,930
Now, currently I have a small table of data.
15
00:01:10,940 --> 00:01:13,240
I have some, let's say, employee names.
16
00:01:13,240 --> 00:01:15,790
I have their department and I have this salary.
17
00:01:16,540 --> 00:01:22,000
And what I want to do is I want to be able to select their name from a dropdown list and have it returned,
18
00:01:22,000 --> 00:01:23,890
the department and the salary.
19
00:01:24,610 --> 00:01:27,280
So we need some index and match formulas in here.
20
00:01:27,670 --> 00:01:32,290
But the first thing we need to do is create a data validation dropdown list.
21
00:01:32,920 --> 00:01:34,450
Now why do we need to do that?
22
00:01:34,480 --> 00:01:36,720
Why can I not just type in the name?
23
00:01:36,730 --> 00:01:38,950
So, for example, Sarah Jones?
24
00:01:39,730 --> 00:01:43,000
Well, the answer is I can just type in the name if I want to.
25
00:01:43,300 --> 00:01:49,630
But if I want to flip between lots of different employees typing in their name each time is going to
26
00:01:49,720 --> 00:01:51,610
start to become a little bit tedious.
27
00:01:52,300 --> 00:01:58,450
It also means that if somebody accidentally typed in the wrong word or they misspell, Let's say they
28
00:01:58,450 --> 00:02:04,060
spell Sarah like that instead, it means that these index match formulas aren't going to work because
29
00:02:04,060 --> 00:02:06,250
they're going to be looking for a different value.
30
00:02:06,790 --> 00:02:12,070
So we can control what goes into this cell by creating a dropdown list.
31
00:02:12,670 --> 00:02:14,620
And this is a super easy thing to do.
32
00:02:14,890 --> 00:02:21,040
All we need to do is click in the cell where we want to add our dropdown list, go up to the data tab
33
00:02:21,040 --> 00:02:23,860
and into data validation.
34
00:02:24,760 --> 00:02:28,540
Let's click the button to open up the dialog box.
35
00:02:29,350 --> 00:02:30,820
Now I'm going to put him over there.
36
00:02:31,960 --> 00:02:36,730
Now, notice we have three tabs, settings, input message and error alerts.
37
00:02:37,330 --> 00:02:40,030
So let's deal with settings, first of all.
38
00:02:40,840 --> 00:02:44,530
Now there are a few different types of data validation that you can do.
39
00:02:44,980 --> 00:02:50,890
And as I said, the one that I use most frequently is this option here, creating validation lists.
40
00:02:51,490 --> 00:02:52,840
So let's click on list.
41
00:02:53,530 --> 00:02:56,140
We can now choose the source for our list.
42
00:02:56,830 --> 00:03:02,260
So I want all of the names to appear in this list, so all I need to do is select the cell range that
43
00:03:02,260 --> 00:03:03,670
contains those names.
44
00:03:04,420 --> 00:03:06,020
Click on OK.
45
00:03:06,430 --> 00:03:11,800
And just like that, I now have this little in-cell dropdown, which is going to allow me to select
46
00:03:12,040 --> 00:03:15,700
the different employees from a nice, concise list.
47
00:03:16,030 --> 00:03:21,040
Now I'm quickly going to add in the index and match formulas, so join me back here in a couple of seconds.
48
00:03:21,790 --> 00:03:22,560
So there we go.
49
00:03:22,570 --> 00:03:26,800
I can see that Michael Parks is in the marketing department and there is his salary.
50
00:03:27,460 --> 00:03:31,240
If I switch to somebody else in the list, that is going to update.
51
00:03:31,420 --> 00:03:36,760
So that is how you can control what goes into the cell using a data validation list.
52
00:03:37,090 --> 00:03:41,830
Now this is all well and good, but let's take a look at a couple of different scenarios and issues
53
00:03:41,830 --> 00:03:44,080
that can come up with this data validation list.
54
00:03:44,920 --> 00:03:52,210
Now, the first issue is if you have duplicates of the name in this example, in the list.
55
00:03:52,930 --> 00:03:55,480
So what about if I have missing Sierra a few times?
56
00:03:55,480 --> 00:03:57,220
Let's add more
57
00:03:59,800 --> 00:04:01,570
now if I go back to my dropdown list.
58
00:04:01,900 --> 00:04:06,850
Notice the dropdown list hasn't updated, even though I've added more people onto the end.
59
00:04:07,570 --> 00:04:13,360
So what I would need to do here is go back into data validation and update my range.
60
00:04:13,960 --> 00:04:19,120
So if I delete this out, my source is now going to be this range just here.
61
00:04:20,110 --> 00:04:27,220
But if I click the drop down notice that I have Mencia listed now four times in this list, so data
62
00:04:27,220 --> 00:04:31,450
validation doesn't pick out specifically unique values.
63
00:04:31,720 --> 00:04:35,950
It's just going to list out everything that you've selected, whether it's a duplicate or not.
64
00:04:36,580 --> 00:04:42,070
And a lot of the time, even if you do have duplicate values, you just want them listed once in your
65
00:04:42,070 --> 00:04:42,910
dropdown list.
66
00:04:43,960 --> 00:04:45,460
So how can we get around that?
67
00:04:45,670 --> 00:04:51,880
Well, the way that I do this is I use the unique function to create a unique list, first of all.
68
00:04:52,180 --> 00:04:58,900
So what I would do here is if I did have duplicates, I would choose a column maybe over here and I
69
00:04:58,900 --> 00:05:01,270
would use the unique function.
70
00:05:02,200 --> 00:05:04,420
I'm going to select my range.
71
00:05:05,440 --> 00:05:11,950
Close the bracket and Hansa, and that's going to give me just the unique values from this list, and
72
00:05:11,950 --> 00:05:15,550
I can now use this list as my data validation.
73
00:05:15,880 --> 00:05:22,150
So if you go back into data validation and just clear out what's in there, I can simply select these
74
00:05:22,150 --> 00:05:22,780
values.
75
00:05:23,080 --> 00:05:27,700
Click on OK, and now I get that unique list in my dropdown.
76
00:05:27,980 --> 00:05:30,690
And of course, we don't want people to see these values.
77
00:05:30,700 --> 00:05:33,610
You can simply hide that column.
78
00:05:34,910 --> 00:05:38,090
You could even put it on an entirely different worksheet if you wanted to.
79
00:05:38,420 --> 00:05:41,990
So that is one way you can deal with duplicate values.
80
00:05:42,350 --> 00:05:46,400
Let's take a look at another scenario that can throw off some problems.
81
00:05:47,000 --> 00:05:51,950
So I'm going to analyze this column, and I'm just going to delete everything out of here.
82
00:05:52,340 --> 00:05:57,200
Now, notice as soon as I do that, all the values disappear from this dropdown list.
83
00:05:57,680 --> 00:06:02,390
Now, another issue you'll come across with these dropdown lists is that they don't automatically update
84
00:06:02,630 --> 00:06:05,030
when you add new values on to the bottom.
85
00:06:05,270 --> 00:06:11,690
So if this list grows and I start to add more people in, my data validation isn't going to automatically
86
00:06:11,690 --> 00:06:13,850
update and accommodate the new values.
87
00:06:14,390 --> 00:06:15,890
So how can we get around this?
88
00:06:16,520 --> 00:06:22,080
Well, one way that we could do this is to put this data into a table control T.
89
00:06:22,820 --> 00:06:24,470
Yes, my table has headers.
90
00:06:24,560 --> 00:06:25,610
Click on OK.
91
00:06:26,930 --> 00:06:28,690
And let's just change the formatting.
92
00:06:28,700 --> 00:06:30,080
So that is a little bit ugly.
93
00:06:30,380 --> 00:06:31,160
There we go.
94
00:06:31,850 --> 00:06:38,330
So now if I type a new name on the bottom, the table is going to expand.
95
00:06:39,080 --> 00:06:43,310
So let's just type in some values in here.
96
00:06:44,120 --> 00:06:46,640
So how does this work with our data validation?
97
00:06:47,420 --> 00:06:51,290
Well, let's go up to data into data validation.
98
00:06:51,890 --> 00:06:57,420
When our source this time is going to be this column just here and click on.
99
00:06:57,440 --> 00:06:58,040
OK.
100
00:06:59,180 --> 00:07:01,370
So now I get all of those names.
101
00:07:01,580 --> 00:07:04,730
Now does this update when I add a new name onto the bottom?
102
00:07:04,940 --> 00:07:05,600
Let's see.
103
00:07:09,890 --> 00:07:13,070
Let's click our dropdown and see if Maggie is on the end.
104
00:07:13,190 --> 00:07:14,580
Yes, she is.
105
00:07:15,290 --> 00:07:20,990
So using a table is a great way to get this list to dynamically update.
106
00:07:21,350 --> 00:07:25,250
Let's add another one just to check to make sure let's click the dropdown.
107
00:07:25,610 --> 00:07:27,080
And there we go.
10533
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.