Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:05,200 --> 00:00:13,360
In the last lesson, I showed you how you can create a rather long nested if statement in order to perform
2
00:00:13,360 --> 00:00:15,640
multiple logical tests.
3
00:00:16,300 --> 00:00:19,990
And what we ended up with was a pretty long formula.
4
00:00:20,110 --> 00:00:27,850
Now I did mention that in recent versions of Excel, there's been a new formula added called IFF s,
5
00:00:28,030 --> 00:00:33,250
which makes constructing nested if statements a little bit more efficient.
6
00:00:33,670 --> 00:00:36,310
And I emphasize the word a little bit.
7
00:00:36,610 --> 00:00:43,420
It really just means you don't have to keep typing in if each time you can go straight into the logical
8
00:00:43,420 --> 00:00:43,930
statement.
9
00:00:44,140 --> 00:00:49,540
So it is a little bit more efficient, but don't be expecting it to drastically decrease the amount
10
00:00:49,540 --> 00:00:51,850
of time you spend constructing this formula.
11
00:00:52,570 --> 00:00:54,640
So let me show you a couple of different examples.
12
00:00:55,300 --> 00:00:59,800
Now we're going to do the same example again, just so you can see how it compares to the nested if
13
00:00:59,800 --> 00:01:01,810
statement on familiar data.
14
00:01:01,990 --> 00:01:08,020
So if I want to do basically the same thing as what we did in the last lesson and output the bonus based
15
00:01:08,020 --> 00:01:12,760
on the job rating, instead of doing all of those if statements, I could use the F.
16
00:01:12,760 --> 00:01:13,810
S function.
17
00:01:14,650 --> 00:01:17,080
I'm going to press the tab key to select it from the list.
18
00:01:17,590 --> 00:01:19,030
Logical test one.
19
00:01:19,570 --> 00:01:21,310
So we're doing the same thing here.
20
00:01:21,910 --> 00:01:32,890
So if the job rating in G four is equal to five f four to lock that cell, if that is true, we want
21
00:01:32,890 --> 00:01:37,240
it to return a bonus of three thousand f four to lock the cell.
22
00:01:38,200 --> 00:01:44,260
Now, in the old nested f way of doing this, we would then need to go in and start typing in our if
23
00:01:44,260 --> 00:01:44,800
statement.
24
00:01:45,400 --> 00:01:46,360
Now, with the F.
25
00:01:46,360 --> 00:01:48,880
S function, we don't have to do that.
26
00:01:48,910 --> 00:01:52,150
We can literally go straight into logical test number two.
27
00:01:52,630 --> 00:01:53,950
So we don't have to type in F.
28
00:01:53,950 --> 00:02:05,100
We can simply say f g four is equal to four at four o'clock, then they're going to get a bonus of fifteen
29
00:02:05,290 --> 00:02:05,790
hundred.
30
00:02:06,460 --> 00:02:07,990
We don't need the f statement again.
31
00:02:07,990 --> 00:02:18,760
We can say f g four is equal to three, then they're going to get a bonus of 900 so on and so forth.
32
00:02:18,940 --> 00:02:22,890
I also don't need a false argument here, so I can literally carry on going through.
33
00:02:22,900 --> 00:02:25,510
I'm going to stop there because I think you've got the idea.
34
00:02:25,990 --> 00:02:31,990
I simply need to close my bracket if I do a control answer and then copy down.
35
00:02:32,770 --> 00:02:38,920
Notice that for the ones that I've said this for, so job rating five, four and three, I have values
36
00:02:38,920 --> 00:02:39,400
in there.
37
00:02:40,040 --> 00:02:45,400
This time I have an A because I have an assigned job ratings one and two to anything.
38
00:02:45,400 --> 00:02:47,780
So Excel doesn't know what to do here.
39
00:02:47,830 --> 00:02:50,080
So that is why I have an RN error.
40
00:02:50,710 --> 00:02:55,750
And towards the end of this section, I'm going to show you how you can deal with things like any errors
41
00:02:55,750 --> 00:02:56,650
in your worksheet.
42
00:02:56,650 --> 00:03:01,270
I make those more meaningful as well, but hopefully you get the idea as to how F.
43
00:03:01,270 --> 00:03:04,660
S works is basically the same as doing nested f statements.
44
00:03:04,660 --> 00:03:10,930
Except you don't need to keep typing if into the formula and you don't need to provide a false result
45
00:03:10,930 --> 00:03:11,500
on the end.
46
00:03:11,800 --> 00:03:15,340
Let's take a look at another example of how we can use if s.
47
00:03:15,580 --> 00:03:22,090
Now here we're going to construct a basic if s formula that's going to return the day of the week when
48
00:03:22,090 --> 00:03:23,830
a day number is typed in.
49
00:03:24,760 --> 00:03:28,320
So the way that I see this is that Sunday is day number one.
50
00:03:28,420 --> 00:03:32,230
Monday is day two, Tuesday, day three, so on and so forth.
51
00:03:32,860 --> 00:03:39,880
And I want people to be able to come down here and enter in number four and have it return the day from
52
00:03:39,880 --> 00:03:41,020
this list above here.
53
00:03:41,230 --> 00:03:46,090
So we can do this using if s so we can say equals if!
54
00:03:46,090 --> 00:03:54,580
S So if the value in this cell, which is currently empty at the moment, is equal to one.
55
00:03:55,090 --> 00:03:57,250
Now I am going to hardcoded this in here.
56
00:03:57,250 --> 00:04:02,770
But as I said, you may want to list one to seven out somewhere in your spreadsheet so you can use that
57
00:04:02,770 --> 00:04:03,580
cell reference.
58
00:04:03,760 --> 00:04:06,060
But for the time being, let's just leave it on one.
59
00:04:06,070 --> 00:04:15,310
So if the number in A11 is equal to one, if that's true, I want it to return the results of Sunday
60
00:04:15,580 --> 00:04:18,210
comma straight into logical test.
61
00:04:19,000 --> 00:04:24,160
If the value in A11 is equal to two, it's going to return a result of Monday.
62
00:04:24,940 --> 00:04:26,470
I'm going to carry on going.
63
00:04:26,470 --> 00:04:32,200
So if A11 is equal to three, we're going to get a result of Tuesday.
64
00:04:32,740 --> 00:04:35,590
So let's just carry on going through all of these.
65
00:04:35,590 --> 00:04:40,180
If A11 is equal to four, then we're going to get Wednesday.
66
00:04:41,380 --> 00:04:43,180
A11 is equal to five.
67
00:04:43,630 --> 00:04:44,890
We're going to get Thursday.
68
00:04:45,490 --> 00:04:50,100
If A11 is equal to six, then we're going to get Friday.
69
00:04:50,110 --> 00:04:59,710
And then finally, if A11 is equal to seven, we're going to get Saturday close off the if s and hit
70
00:04:59,710 --> 00:05:01,410
enter now.
71
00:05:01,420 --> 00:05:04,650
Currently, we have an enemy error in here because.
72
00:05:04,760 --> 00:05:13,250
We don't have anything in cell A-11, and this formula consistently refers to that cell looking for
73
00:05:13,250 --> 00:05:13,970
a number.
74
00:05:14,210 --> 00:05:16,500
But now if I add, let's say two.
75
00:05:17,150 --> 00:05:18,830
It's going to give me my result.
76
00:05:19,730 --> 00:05:28,220
Let's add seven and it changes if I add something outside of the criteria that I specified, I'm going
77
00:05:28,250 --> 00:05:29,900
to get an NRA.
78
00:05:30,710 --> 00:05:37,340
Now, my be again, that you want to add in some error checking so that if somebody types in a number
79
00:05:37,340 --> 00:05:40,520
outside of one to seven instead of just getting.
80
00:05:41,300 --> 00:05:46,190
You want it to say to them, please type a number between one and seven.
81
00:05:46,500 --> 00:05:51,740
And we're going to explore how we would do something like that towards the end of this section when
82
00:05:51,740 --> 00:05:53,060
we look at error checking.
83
00:05:53,330 --> 00:05:57,380
But those are a couple of different examples of how you can use if s.
84
00:05:57,860 --> 00:06:04,310
And hopefully that illustrates quite nicely the differences between nested ifs and the effects formula.
8164
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.