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
€93.23
List Price:  €130.53
You save:  €37.29
£79.94
List Price:  £111.92
You save:  £31.98
CA$136.79
List Price:  CA$191.52
You save:  CA$54.72
A$153.20
List Price:  A$214.48
You save:  A$61.28
S$135.94
List Price:  S$190.32
You save:  S$54.38
HK$782.80
List Price:  HK$1,095.96
You save:  HK$313.15
CHF 91.30
List Price:  CHF 127.83
You save:  CHF 36.52
NOK kr1,094.90
List Price:  NOK kr1,532.91
You save:  NOK kr438
DKK kr695.39
List Price:  DKK kr973.58
You save:  DKK kr278.18
NZ$167.81
List Price:  NZ$234.95
You save:  NZ$67.13
د.إ367.25
List Price:  د.إ514.16
You save:  د.إ146.91
৳10,958.03
List Price:  ৳15,341.69
You save:  ৳4,383.65
₹8,331.80
List Price:  ₹11,664.86
You save:  ₹3,333.05
RM477.70
List Price:  RM668.80
You save:  RM191.10
₦126,689.32
List Price:  ₦177,370.12
You save:  ₦50,680.80
₨27,798.13
List Price:  ₨38,918.49
You save:  ₨11,120.36
฿3,702.20
List Price:  ฿5,183.23
You save:  ฿1,481.03
₺3,249.97
List Price:  ₺4,550.10
You save:  ₺1,300.12
B$514.66
List Price:  B$720.55
You save:  B$205.88
R1,901.16
List Price:  R2,661.70
You save:  R760.54
Лв182.41
List Price:  Лв255.39
You save:  Лв72.97
₩137,421.64
List Price:  ₩192,395.79
You save:  ₩54,974.15
₪379.55
List Price:  ₪531.39
You save:  ₪151.83
₱5,778.57
List Price:  ₱8,090.23
You save:  ₱2,311.66
¥15,552.99
List Price:  ¥21,774.81
You save:  ¥6,221.82
MX$1,705.36
List Price:  MX$2,387.58
You save:  MX$682.21
QR364.16
List Price:  QR509.84
You save:  QR145.68
P1,384.82
List Price:  P1,938.81
You save:  P553.98
KSh13,448.65
List Price:  KSh18,828.65
You save:  KSh5,380
E£4,789.16
List Price:  E£6,705.01
You save:  E£1,915.85
ብር5,677.33
List Price:  ብር7,948.49
You save:  ብር2,271.15
Kz83,741.62
List Price:  Kz117,241.62
You save:  Kz33,500
CLP$95,258.47
List Price:  CLP$133,365.67
You save:  CLP$38,107.20
CN¥724.52
List Price:  CN¥1,014.36
You save:  CN¥289.84
RD$5,872.31
List Price:  RD$8,221.47
You save:  RD$2,349.16
DA13,431.87
List Price:  DA18,805.15
You save:  DA5,373.28
FJ$229.18
List Price:  FJ$320.86
You save:  FJ$91.68
Q776.12
List Price:  Q1,086.60
You save:  Q310.48
GY$20,901.55
List Price:  GY$29,263
You save:  GY$8,361.45
ISK kr13,994.60
List Price:  ISK kr19,593
You save:  ISK kr5,598.40
DH1,013.23
List Price:  DH1,418.56
You save:  DH405.33
L1,780.93
List Price:  L2,493.37
You save:  L712.44
ден5,743.61
List Price:  ден8,041.28
You save:  ден2,297.67
MOP$805.67
List Price:  MOP$1,127.97
You save:  MOP$322.30
N$1,914.68
List Price:  N$2,680.63
You save:  N$765.95
C$3,675.06
List Price:  C$5,145.23
You save:  C$1,470.17
रु13,310.19
List Price:  रु18,634.81
You save:  रु5,324.61
S/370.43
List Price:  S/518.62
You save:  S/148.18
K379.55
List Price:  K531.39
You save:  K151.83
SAR375.02
List Price:  SAR525.04
You save:  SAR150.02
ZK2,608.51
List Price:  ZK3,652.02
You save:  ZK1,043.50
L463.96
List Price:  L649.56
You save:  L185.60
Kč2,349.11
List Price:  Kč3,288.85
You save:  Kč939.73
Ft36,594.60
List Price:  Ft51,233.91
You save:  Ft14,639.30
SEK kr1,086.27
List Price:  SEK kr1,520.82
You save:  SEK kr434.55
ARS$87,315.45
List Price:  ARS$122,245.13
You save:  ARS$34,929.67
Bs689.99
List Price:  Bs966.01
You save:  Bs276.02
COP$389,137.18
List Price:  COP$544,807.62
You save:  COP$155,670.43
₡50,081.85
List Price:  ₡70,116.60
You save:  ₡20,034.74
L2,464.83
List Price:  L3,450.86
You save:  L986.03
₲741,742.01
List Price:  ₲1,038,468.49
You save:  ₲296,726.47
$U3,834.62
List Price:  $U5,368.62
You save:  $U1,534
zł402.27
List Price:  zł563.20
You save:  zł160.92
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.