Logical Functions

18 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$99.99
List Price:  $139.99
You save:  $40
€95.85
List Price:  €134.19
You save:  €38.34
£79.54
List Price:  £111.35
You save:  £31.81
CA$143.73
List Price:  CA$201.23
You save:  CA$57.50
A$159.93
List Price:  A$223.91
You save:  A$63.97
S$135.54
List Price:  S$189.77
You save:  S$54.22
HK$777.83
List Price:  HK$1,089
You save:  HK$311.16
CHF 89.34
List Price:  CHF 125.09
You save:  CHF 35.74
NOK kr1,131.88
List Price:  NOK kr1,584.68
You save:  NOK kr452.80
DKK kr715.08
List Price:  DKK kr1,001.15
You save:  DKK kr286.06
NZ$176.75
List Price:  NZ$247.46
You save:  NZ$70.70
د.إ367.26
List Price:  د.إ514.18
You save:  د.إ146.92
৳11,945.33
List Price:  ৳16,723.94
You save:  ৳4,778.61
₹8,493.77
List Price:  ₹11,891.62
You save:  ₹3,397.85
RM450.75
List Price:  RM631.07
You save:  RM180.32
₦154,938.50
List Price:  ₦216,920.10
You save:  ₦61,981.60
₨27,824.38
List Price:  ₨38,955.25
You save:  ₨11,130.86
฿3,419.79
List Price:  ฿4,787.84
You save:  ฿1,368.05
₺3,519.01
List Price:  ₺4,926.76
You save:  ₺1,407.74
B$608.53
List Price:  B$851.97
You save:  B$243.44
R1,830.80
List Price:  R2,563.19
You save:  R732.39
Лв187.32
List Price:  Лв262.25
You save:  Лв74.93
₩144,627.53
List Price:  ₩202,484.33
You save:  ₩57,856.80
₪365.39
List Price:  ₪511.57
You save:  ₪146.17
₱5,882.91
List Price:  ₱8,236.31
You save:  ₱2,353.40
¥15,643.93
List Price:  ¥21,902.13
You save:  ¥6,258.20
MX$2,007.58
List Price:  MX$2,810.70
You save:  MX$803.11
QR364.41
List Price:  QR510.19
You save:  QR145.78
P1,381.63
List Price:  P1,934.33
You save:  P552.70
KSh12,923.70
List Price:  KSh18,093.70
You save:  KSh5,170
E£5,087.81
List Price:  E£7,123.14
You save:  E£2,035.32
ብር12,764.56
List Price:  ብር17,870.89
You save:  ብር5,106.33
Kz91,790.82
List Price:  Kz128,510.82
You save:  Kz36,720
CLP$98,905.10
List Price:  CLP$138,471.10
You save:  CLP$39,566
CN¥729.56
List Price:  CN¥1,021.42
You save:  CN¥291.85
RD$6,087.13
List Price:  RD$8,522.23
You save:  RD$2,435.09
DA13,485.25
List Price:  DA18,879.89
You save:  DA5,394.64
FJ$231.62
List Price:  FJ$324.28
You save:  FJ$92.66
Q770.23
List Price:  Q1,078.35
You save:  Q308.12
GY$20,913.67
List Price:  GY$29,279.97
You save:  GY$8,366.30
ISK kr13,911.60
List Price:  ISK kr19,476.80
You save:  ISK kr5,565.20
DH1,006.07
List Price:  DH1,408.53
You save:  DH402.46
L1,836.70
List Price:  L2,571.46
You save:  L734.75
ден5,900.06
List Price:  ден8,260.33
You save:  ден2,360.26
MOP$800.26
List Price:  MOP$1,120.39
You save:  MOP$320.13
N$1,840.36
List Price:  N$2,576.58
You save:  N$736.22
C$3,678.42
List Price:  C$5,149.94
You save:  C$1,471.51
रु13,597.49
List Price:  रु19,037.04
You save:  रु5,439.54
S/372.23
List Price:  S/521.13
You save:  S/148.90
K405.36
List Price:  K567.52
You save:  K162.16
SAR375.62
List Price:  SAR525.88
You save:  SAR150.26
ZK2,766.46
List Price:  ZK3,873.15
You save:  ZK1,106.69
L477.10
List Price:  L667.96
You save:  L190.86
Kč2,408.98
List Price:  Kč3,372.68
You save:  Kč963.69
Ft39,689.03
List Price:  Ft55,566.23
You save:  Ft15,877.20
SEK kr1,103.13
List Price:  SEK kr1,544.43
You save:  SEK kr441.30
ARS$102,160.40
List Price:  ARS$143,028.65
You save:  ARS$40,868.24
Bs690.76
List Price:  Bs967.10
You save:  Bs276.33
COP$435,928.80
List Price:  COP$610,317.76
You save:  COP$174,388.96
₡50,434.81
List Price:  ₡70,610.75
You save:  ₡20,175.94
L2,537.51
List Price:  L3,552.62
You save:  L1,015.10
₲779,455.88
List Price:  ₲1,091,269.42
You save:  ₲311,813.53
$U4,474.38
List Price:  $U6,264.31
You save:  $U1,789.93
zł408.66
List Price:  zł572.14
You save:  zł163.48
Already have an account? Log In

Transcript

Objectives by the end you should be able to use logical functions and if not, and or use a combination of functions. Use nested if functions use the sum and average functions, use the AutoSum icon, use the formula text function, use the sum F and sum ifs functions, analyze functions using the functions argument window. Now, we will see how to use some of the logical functions that I have mentioned in Excel like and if not all, and we will try to get some interesting outputs out of them by mixing one function with the other in the sense we will use an IF function inside another IF function. I will try a combination of an R and end function together and see See what interesting output we can make? Let us begin let us consider an example. I like to order a number of things online even groceries and I like to keep a track of when I ordered them and when I received them and the total cost that I spent on them and now, here is my food supply inventory.

I have ordered some tomatoes, black beans, all purpose law etc. and the quantity for the same I have mentioned with price per unit. Now, what I want to do is to calculate the total cost. So, I would write equal to quantity that is cell B three into price per unit that is cell C three and hit on Enter after getting the total cost I would say Select this cell and clicking on this small box with the left mouse button, I would drag it down till the last cell. And I can see that Excel has calculated the total of all the quantity and the price and has given me the total cost of each. Next is I want to know how many items have I ordered.

So in this cell, I would write equal to sum, open bracket and select all these cells, close bracket and Enter. Now I get the number of items that I have ordered. Another way to go about this is by going to the top over here and selecting this AutoSum button. It automatically understands how many cells about it to include for calculating The total and it is showing over here with the dotted lines moving around the self selected, I will simply hit on Enter and I can see the total quantity ordered average price per unit can be calculated by writing equal to a VR AG average open bracket and selecting all these cells, close bracket and hit on Enter. Next is total cost, total cost is equal to some open bracket, sum of all these cells close bracket and enter. With this, my basic sheet is ready for further analysis.

Now let us challenge Excel and see if it can help us understand certain hypothetical scenario Use that we create. The first scenario is, I want to find out if the quantity of items ordered by me is more than 50 or not. So for that, what I'll do is equal to a function, open bracket. By the way, what we can also do is when we write if, and we can see that Excel has given us three options over here, we can choose the option by hitting on the tab key. So now let us write further, we have if the condition is that this cell is greater than 50. And if that is so then Excel should tell me that I have exceeded my budget.

And if that is not the case, and if the number of items ordered is less than or equal to 50, then it should tell me that I am within my budget, and then that in place, I will close the bracket and hit on Enter. So yes, it It is telling me that I have exceeded my budget. Let us analyze this function by going to the formula bar and clicking on effects over here, it tells me that the logical test is the cell B 16. That is the quantity of items ordered. If this condition is true, then it will tell me you have exceeded your budget. Else if it is false, then it will tell you that you are within your budget.

If we are writing any textual message in Excel as an output, we need to put it in double quotes. And that's what I have done over here. Had it been a numerical value, then we would have simply written like this, I will change the first part also. I will write one if it is greater than 50 and zero if it is not. And now it has showing that I have exceeded number So, this way we can use the IF function I will just get back to the previous sentence format. Now, with this basic if sentence in place, I would like to go further and find out if my total cost is exceeding my budget or not.

For that I would write a similar sentence equal to if pressing the tab key, this particular cell is greater than 500. If that is so, I would like Excel to tell me that my total cost is exceeding and if that is not the case, then my total cost is not exceeding my budget, close bracket and enter. So, here also Excel tells me that my total budget is getting exceeded, I will just change this total value to 1000. So, now, it is telling me that the total cost is not exceeding your budget what is If we want to find out in just one cell, that our quantity ordered or our total cost is not exceeding my budget and both have different conditions, the quantity ordered, if it is more than 50 then it should tell me that it is exceeding my budget and the total cost if it is more than thousand, then it should tell me that I am Exceeding my total cost.

So, this is a classic case of an or statement. In order to frame an or statement, we shall write equal to or logical one that is this greater than 50 comma because now we want to write another condition logical to is this greater than thousand for the output of this statement will be either true or false. In our case, it is true because quantity of items ordered is more than 50. Now had this condition been more than hundred, then this condition would have changed to false. What if I say that instead of an or statement, I would like to know, if my quantity ordered and the total cost both are more than a prescribed limit. For example, the quantity ordered is more than 50 and the total cost is going more than thousand.

In that case, let us see an and condition we would require an end formula and we'll write it this way, equal to and logical one, this condition greater than 50 comma, this condition is greater than thousand, close bracket and Enter. And now when we will press enter, it will tell us that this is False why, because although the quantity of items ordered is more than 50, the cost is not going to more than thousand. Hence the condition is false had this total been more than thousand, say for example 1100 then the condition would have converted to true. Now, let us complicate this a little bit more, what we will do now is we will try to write an or statement inside an if condition, what we want to find out is, if the quantity of items ordered is more than 50 or the total cost is more than 500 then it should tell me that I have exceeded my budget instead of writing these two if conditions.

It would be great if we could merge it in one like this equal to if or logic one Is this cell greater than 50 or this cell is greater than 500. If this is true, then tell me that I have exceeded else tell me that I have not exceeded close bracket enter. So, here we can see a very simple example of using an or statement inside an IF function. Similarly, we could have also put an end function inside an IF function like this. So, here it tells me that I have exceeded 50 in the quantity of items ordered and also have exceeded 500 in the total cost of items. And hence, it is showing that output is exceeded.

Now let us try to write a formula in which there is an if condition inside another if condition, such kind of formulas are known as nested, if let me create a scenario for you, I want to know if my number of items ordered are more than 50 and the total cost is going more than 500 then I want Excel to tell me that the number of items is more and the total cost is also more else, if the items are more than 50, but the cost is less than 500 then it should tell me accordingly also, if the items are less than 50, it should tell that the number of items is less than 50. In order to write this in a formula, please go like this equal to if the first test is whether the quantity is more than 50 or not. And if this is true, then I would like to check whether the total cost is More than 500 and not in order to put that we would write if this is greater than 500 then it should tell me that the quantity is more and the cost is more else it would tell me that the quantity is more, but the cost is less close the bracket and the last condition is that the quantity is less close bracket enter in our case, it is telling me Yes, the quantity is more than 50 and the cost is more than 50 and it is showing like this.

We will try different scenarios. What if the total cost was less than 500 say 450. So, now this condition has changed, the quantity is more but the cost is less If the quantity of items ordered is less than 50 say 45. So, here it is showing that the quantity is less in order to go deep inside this function and understand it, we can click this FX and it will tell us that the first condition is the B 16 greater than 50. And then if it is true, then there is another if condition which says that if the 18 that is the total cost is more than 500 then it should show a particular value and if it is less then it should show a particular value else if this condition the first condition is false then it will directly go over here and it will show that the quantity is less like this.

You can form different nested if conditions and create a formula that is desired by you. We have another interesting logical operator Known as the knot function, what this function does is it converts a logical output see a true statement into false and vice versa. Let us see how, let's take average price of unit This time, we'll write this in not statement like this equal to not c 17 greater than 10. In this case, what it will do is we know that it is greater than 10. So it should have been a true if we would have written an if condition. But if I hit on Enter, it will tell me false.

That means it is just converting a true statement to false statement and representing this can be really useful in some of the scenarios. One may require to see what Formula One has written in any particular cell. Excel has provided such a condition and that too, is a formula For example, if I want to see what formula I have written over here, I would have to go to the top and see in the function bar. Instead of that, I could write a formula next to it equal to formula, select formula text, select the joining cells, f 23, close bracket, and enter. Here, it converts the formula that was there in this cell and write it as a text. This can be very helpful in some of the cases.

Let us see how to use sum if and sum ifs function. What sum if does is it adds up a number of cells based on one single criteria. And what sum ifs does is it adds a number of cells based on multiple criteria. Let us take a very small example. I want to add the total cost of All those items whose quantity is more than five, in order to write this in a scenario, I would write equal to sum F, select the range, that is quantity on which we want to put some criteria comma, the criteria in double quotes greater than five comma, the column where we want to some close bracket and enter. So, here, we can see the total cost of all the items.

Let us now create a criteria in which we want to find out the sum of the total cost of all the items where the quantity is more than five and the price per unit is less than 10. We will write equal to sum ifs open bracket. Now here there is a difference is some f v had written the summing range at the end But for some ifs function, we need to write this coming range first, that is the cells that will be added up, comma, the cells on which we would like to put some criteria. So here, I will select the quantity column, comma, I will put the criteria for the same, greater than five. Second, the range of cells on which I would like to put some other criteria, comma, and here I would write the criteria, see less than five, close bracket, enter. Now he'll we can see that Excel is adding up all these cells, wherever the quantity is more than five, that is 123 and four cells, and the price per unit is less than five.

That is, among the cells. Only the cells that satisfy the condition are these too and hence the get the sub summary you have learned logical functions and if not, and or using a combination of functions, nested if functions, sum and average functions using the AutoSum button, formula text function, sum F and sum ifs function analyzing the functions using function argument window.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.