Excel IF Formula: Simple to Advanced (multiple criteria, nested IF, AND, OR functions)

Excel IF Formula: Simple to Advanced (multiple criteria, nested IF, AND, OR functions)


Excel IF Formula: Simple to Advanced (multiple criteria, nested IF, AND, OR functions)

Join 400,000+ professionals in our courses: https://www.xelplus.com/courses/

Learn how to use Excel’s IF Function in your reports.

00:00 When to use the Excel IF function
00:35 When to use a Nested IF formula
00:55 Excel IF THEN formula
03:18 Excel IF formula with AND condition
05:05 Nested Excel IF formula
07:52 Excel IF formula with OR condition
09:17 Excel IF formula with threshold
11:22 Excel IF formula with symbols for result
14:29 Wrap-Up of different uses of Excel IF function

⯆ Download the workbook here: http://www.xelplus.com/excel-if-formu

We cover a few examples in this tutorial including:
1. Simple IF function (also with greater than or less than checks).
2. IF Formula together with AND logical test to decide outcome if more than one condition is met.
3. Nested IF formula (an IF inside another IF) to check for multiple criteria.
4. IF formula with OR function (to check if “either” condition is met and then decide the outcome).
5. We also take a look at using formulas (other calculations) inside the IF function and finally:
6. How to use symbols as the result of the IF formula

Your IF formula isn’t working? One of the main mistakes is the “else” argument. That’s the last argument inside the IF function. Make sure you haven’t forgotten to specify what should happen “if” the condition isn’t met. In case you have more than one condition, here’s the place to add the second “if” statement. An IF formula inside another IF formula is called a nested if function.

Links to related videos:
Conditional formatting symbols:    • Excel Conditional Formatting with Sym…  
Custom formatting symbols:    • 4 SMART Ways to use Custom Formatting…  
If Function with Partial text match:    • Excel IF Function with PARTIAL Text M…  

★ My Online Excel Courses ► https://www.xelplus.com/courses/

✉ Subscribe \u0026 get my TOP 10 Excel formulas e-book for free
https://www.xelplus.com/free-ebook/

RESOURCES I Recommend: https://www.xelplus.com/resources/

More resources on my Amazon page: https://www.amazon.com/shop/leilagharani

Let’s connect on social:
Instagram: https://www.instagram.com/lgharani
Twitter: https://twitter.com/leilagharani
LinkedIn: https://at.linkedin.com/in/leilagharani

Note: This description contains affiliate links, which means at no additional cost to you, we will receive a small commission if you make a purchase using the links. This helps support the channel and allows us to continue to make videos like this. Thank you for your support!

#excel


Content

0.78 -> Today's video is about Excel's IF function.
4.72 -> How can we use it alone?
6.279 -> How do we know if we need more than one IF?
9.82 -> How can we combine it with other logical functions such as AND or OR functions?
21.78 -> Whenever you need a formula that's based on a condition, such as you need to mark or flag
27.42 -> entities separately if their value's above 200 in revenue, an IF can do a good job here.
35.16 -> The way you know if you need a nested if, that means you need to use another IF inside
41.899 -> an IF, is when you use buts in your sentences.
47.39 -> Let's say we need to mark entities if their value is above 200, but if their value is
52.6 -> below 50, we need to follow up on them.
55.69 -> Let's take a look at some examples.
57.519 -> In this example, I have a list of apps, and I have the revenue that's associated with
62.71 -> each app.
64.07 -> I've been asked to solve for these.
66.81 -> For the first case, I need to mark apps with the word Good if the revenue is above 15,000.
73.96 -> We're going to start off with IF.
77.38 -> The first argument is our logical test.
79.9 -> What is our logical test in this case?
83.5 -> Is this value, right?
84.619 -> That's our revenue, and if this is greater than 15,000 ... I can either type it in like
92.84 -> this or if I have these values in other cells, I can reference those cells.
101.02 -> Obviously you're going to be more flexible if you go with a cell referencing route, because
105.729 -> it could be that I change the threshold next month to 20,000.
110.25 -> It's much more transparent and easier for me to manage if I just have to go to one cell
115.299 -> and change that number, instead of finding the formula, changing it in that formula,
120.45 -> and then dragging it down and making sure that it applies to everything else.
123.96 -> I'm not going to type it in here.
126.13 -> I'm actually going to reference this cell, but when you do the cell referencing route,
131.78 -> you have to keep the fixing in mind, Right?
135.569 -> That I can do in one go with the F4 key.
139.59 -> That's basically my logical test.
142.34 -> Check is this value greater than this value.
146.1 -> If it is, then we go to our next argument.
149.64 -> What should it do?
151.89 -> Here I want to type in Good.
154.29 -> Again, I can type it in like this, but you have to be careful, because if you're typing
159.47 -> text in a formula, you have to put it in quotation marks.
163.86 -> In this case, I also want to do a cell reference.
166.93 -> So I'm going to reference this cell, and again I'm going to fix it.
170.75 -> Okay, so that's what it should do if this does happen, and if it doesn't happen, then
178.18 -> I want it to do nothing.
179.86 -> Nothing, in Excel, means you can put in a double quotation mark.
184.98 -> Close the bracket.
185.98 -> Press Enter.
187.459 -> Now we're going to send this formula down and just double check.
192.569 -> This is above 15,000, and these are above 15,000.
195.83 -> Okay, so it looks good.
197.93 -> Now let's go to the next one.
201.129 -> It's not just above 15,000, but we want to mark the entities as Good if the revenue's
207.15 -> greater than 15,000 and less than 20,000.
212.239 -> Situations like this call for the AND function inside the IF function.
220.189 -> AND allows us to do a logical test for more than one thing.
225.06 -> In this case, we have two things to check for.
227.689 -> We're still going to start off with our IF, but right here, before we start typing in
233.159 -> our logical test, we are going to put the AND function first, and type in all our tests
240.549 -> that should occur and should be true inside the AND function, okay?
246.719 -> What's one of these logical tests?
248.319 -> It's the same one we had before.
250.56 -> Is this revenue value greater than this value?
255.239 -> I'm going to fix it.
257.9 -> The next argument is your second logical test.
261.1 -> That's, again, is this value, now we want to say is it less than this value.
268.949 -> I'm going to fix it as well.
270.88 -> Now don't forget to close the bracket for the logical test, for our AND condition here.
278.3 -> The next argument is what should it do if both of these occur, if revenue is in between
283.8 -> 15,000 and 20,000.
286.31 -> We said we want Good.
288.53 -> In this case, I'm going to type it in, otherwise, we want nothing.
293.61 -> Close the bracket.
294.699 -> Press Enter.
296.97 -> Let's see if it filters it out correctly.
300.33 -> These are between, this is between, and that's between.
303.9 -> These are too high.
306.47 -> Next challenge.
307.9 -> If revenue is greater than 15,000 and 20,000, so this is similar to what we did before,
314.37 -> but now we have an additional condition.
317.18 -> If revenue is greater than or equal to 20,000, we want them marked as Exceptional.
324.75 -> Rest is value.
326.06 -> By value, I mean just the value that's in the cell.
329.18 -> Basically, we're going to have a mixed column, some text and some numbers in here.
334.169 -> How do we deal with these conditions?
337.5 -> The first part is exactly like we did before.
341.03 -> I'm actually going to copy this.
343.75 -> Press Escape to leave, and paste it in here.
347.19 -> Let's just bring in my cell references up here.
351.66 -> Okay, because if both of these conditions occurs, then I want Good.
357.21 -> Otherwise, do I want nothing now?
359.91 -> No, because I'm not done with the formula.
362.18 -> I need to test for another condition.
365.13 -> If this doesn't happen, I still now need to go and test is this app an Exceptional app
372.319 -> in terms of revenue.
375.45 -> Exactly in the value if false argument, that's where you need to put your second IF condition.
382.849 -> What is our logical test?
385.19 -> This number, now is it greater than or equal to this number.
391.56 -> I'm going to fix this.
394.259 -> Then what do we want?
395.6 -> We want it to write Exceptional, otherwise ... Otherwise means if none of these occurred
404.039 -> until now, what should it do.
406.93 -> We said we want the value.
408.72 -> I'm just going to do a cell reference here.
411.37 -> Now I have two IFs, so I need two brackets.
417.03 -> Let's just send this down.
419.05 -> Now we have the Good, we have the Exceptional, and for everything else, we have the number.
427.15 -> That's how you can use nested IFs in your formulas.
432.979 -> You're not restricted to two IFs.
434.84 -> You can obviously put another IF here if the value is below another threshold, then do
441.31 -> this, otherwise put the value or put nothing.
444.97 -> It's just that the more nested IFs you have, the more difficult it's going to get to understand
449.949 -> the formula.
451.56 -> One thing to keep in mind is that Excel does leave the formula the moment it comes across
457.129 -> a true condition.
458.669 -> The moment this is true, it puts that Good and it leaves the formula.
462.729 -> It doesn't go and evaluate all your other if conditions.
466.55 -> That's something to keep in mind when you're writing these more complex formulas.
472.63 -> Let's look at another case.
474.38 -> If revenue is greater than or equal to 20,000, or it's less than or equal to 15,000, then
481.889 -> we want to type in Flag.
484.699 -> Basically anything in between, we're going to leave alone.
488.09 -> How do we write this?
490.909 -> I'm going to start with the IF.
492.789 -> Another logical test that we can use is the OR function.
498.699 -> An OR checks for if either of these conditions apply.
503.46 -> The logical test one is this one greater than or equal to this number.
510.65 -> We're going to fix it.
513.58 -> What is logical test two?
516.08 -> Is this number less than or equal to this number?
520.82 -> We're going to fix it.
523.05 -> Don't forget to close your OR condition before you leave.
526.76 -> That's something I sometimes forget.
528.02 -> I continue going, and then I realize, "Oh, I forgot to close that condition."
533.04 -> Next one, what should it do if either of these occur.
535.78 -> Well, we just want to type in the word Flag there, otherwise, we're going to leave them
541.96 -> alone and put nothing.
543.94 -> Okay, so it flagged the first one.
546.89 -> Let's see if that's correct.
549.08 -> Is that less than?
550.19 -> Yes, because it's not in between these.
553.32 -> Flag these, these and these.
555.55 -> Okay?
556.55 -> That looks good.
558.14 -> Now let's take a look at another case where we're going to use bigger formulas inside
563.73 -> our logical test argument.
566.35 -> We have budget values, and we want to show the percentage difference, basically show
573.27 -> the deviation from actual to budget if that deviation is a bigger deviation, that's plus
580.1 -> or minus 10%.
582.04 -> Whenever you come across cases where you have formulas inside your IF function, it's easier
587.75 -> to start with the core formula first.
590.81 -> The core formula in this case is my deviation.
594.31 -> I'm just going to calculate that actual divided by budget minus one.
600.22 -> Let's just drag this down and see what we get.
604.29 -> The aim is not to put anything for these ones that are between plus or minus 10%, so only
612.74 -> put in the bigger deviations in here, which actually is these four numbers.
618.92 -> Okay, so how do we do that?
621.68 -> Let's start off with our IF.
623.78 -> That's a part of my logical test, right?
625.62 -> I want to evaluate the answer of this formula.
629.13 -> What do I need to put in here?
631 -> How do I handle that?
632.03 -> I need the OR function, right?
635.32 -> The OR always comes before.
638.27 -> Right after the IF, I'm going to type in the OR.
641.85 -> My logical test one is to check the result of this formula, and see is it bigger than
647.72 -> 10%.
649.98 -> That's the first logical test.
651.59 -> The second one is take a look at the same formula and see is it less than minus 10%.
659.32 -> Okay, we're going to close the bracket for the OR condition.
664.26 -> What should it do if it's true?
666.61 -> It should give me back the deviation.
669.29 -> I'm going to paste that formula in there.
671.99 -> Otherwise, it should leave it alone and do nothing.
675.18 -> I'm going to close the bracket, and I should just get these four numbers.
683.31 -> In the last example here, I just wanted to show you that you can also use symbols as
688.92 -> your result.
690.58 -> Let's say for the positive deviations, I wanted an up arrow, and for the negative deviations,
696.04 -> or the deviation in this case, I wanted a down arrow.
700.8 -> First step is to bring your symbols in your Excel sheet.
705.21 -> I'm going to do that by going to Insert, Symbols.
709.35 -> The symbols I use most often are under Arial, Geometric Shapes.
712.3 -> You can see them actually here.
716.49 -> Just find the ones that you like, and click on them, press Insert.
721.76 -> That's the up one.
723.74 -> I want the down one.
725.09 -> I'm going to press Insert right there, and then close.
728.55 -> I can use them as text inside formulas by putting them in quotation marks, but I actually
734.64 -> want to do cell references to them, so if I decide to change the symbol to something
738.33 -> else for another type of report, all I have to do is replace that symbol in the cell.
744.01 -> So I'm going to put them in two separate cells.
747.48 -> Let's Control-X.
749.17 -> Cut this one out, and put it right here.
753.57 -> Can I use the same formula for here, and just replace this with the symbol?
759.64 -> I can't right?
761.8 -> Why?
762.82 -> Because I'm using two different symbols, so I need to split them up.
766.7 -> If I was using the same symbol, I can, but I'm not in this case.
772.61 -> Let's just write this one from scratch.
775.79 -> We know our logical test by now, so that's this divided by this minus one.
783.07 -> Let's do the positive one first.
785.75 -> If this is greater than 10%, then we want the symbol, which is this one, and press F4
793.38 -> to fix it.
795.08 -> Otherwise, what do I need right here?
798.16 -> Can I just put the other symbol?
800 -> No.
801 -> If I wanted everything else that wasn't above 10% to show this symbol, than yes, but I don't.
807.17 -> I just want the ones that are below minus 10% to show the other symbol, so I do need
812.74 -> an IF here, and my logical test is the same, so I'm going to copy this and paste it in
820.56 -> here, is less than now it's minus 10%, then this symbol.
827.8 -> Let's fix it.
829.38 -> Otherwise nothing.
830.38 -> Close, close, because I have two IF conditions.
835.11 -> Let's see what we get.
836.84 -> Okay?
837.95 -> That looks good.
839.39 -> Now what you can obviously do to make this simpler is if you calculate this deviation
845.07 -> in a separate column, and then just reference that cell.
848.45 -> That way you don't have to calculate it inside your formula all the time, but I just wanted
853.89 -> to show you that it is common to have formulas, and much bigger and more complex formulas,
861.08 -> inside your IF function.
863.68 -> Depending on the outcome of that formula, it decides which way to go.
869.12 -> Okay, so in this example, we saw different uses of the IF function.
874.37 -> We took a look at a simple version, the version together with AND and OR conditions.
880.92 -> We also took a look at nested IFs, and how to use slightly bigger formulas inside your
886.56 -> IF function, and even how you can use symbols in your formulas.
892 -> One question that can come up is could you color the up arrows in a different color than
896.92 -> your down arrows?
897.95 -> Yes, you can.
899.15 -> You can do it in different ways.
900.63 -> You can either use conditional formatting, or you can also use custom formatting.
905.68 -> I have different videos on these, so I'm going to share the links to those videos in the
911.41 -> descriptions.
912.41 -> If you like this video, don't forget to give it a thumbs up.
915.76 -> For more of these videos, don't forget to subscribe to this channel, so that you can
920.31 -> get updates when new videos come out.

Source: https://www.youtube.com/watch?v=KkTaQ5OjAGc