Expaining+If+and+or+statments+in+further+detail

IF AND OR FUNCTION


 * USEFUL TO LEARN TO BUILD IF AND OR FUNCTIONS :**

The IF function in Excel is one that many Excel newbies don’t understand and, therefore, don’t use. But, this is one function that will make every Excel user’s life so much easier, so I thought I’d write a little introductory tutorial about it.

In a nutshell, the IF statement answers the question, “Is this true or false?”, then proceeds on some action based on this.

The arguments in an If statement are as follows:
 * Logical test** – what are we asking? In this case, let’s say our logical test is “Is the value in Column A larger than the value in Column B?”
 * Value if true** – what do we want displayed if the answer to our question is “true”? In this example, let’s say we want the answer to be “yes”
 * Value if false** – what do we want displayed if the answer is “false”? In this example, let’s say we want “no”.

How do we build an IF statement?
In a formula, the arguments are separated by commas, so for this example, let’s put our formula in cell C2 and this is what it would look like:

=IF(A2>B2,"yes","no")

This says, IF the value in A2 is greater than the value in B2, put yes in C2 and if it’s not greater than B2, put no in C2.
 * NOTE:** When you want text displayed in a cell, you must put the text in quotes in the formula. If instead of yes and no, you wanted to have numbers like 1 and 2, the second two arguments would not require quotes and would look like this:
 * NOTE:** When you want text displayed in a cell, you must put the text in quotes in the formula. If instead of yes and no, you wanted to have numbers like 1 and 2, the second two arguments would not require quotes and would look like this:
 * NOTE:** When you want text displayed in a cell, you must put the text in quotes in the formula. If instead of yes and no, you wanted to have numbers like 1 and 2, the second two arguments would not require quotes and would look like this:
 * NOTE:** When you want text displayed in a cell, you must put the text in quotes in the formula. If instead of yes and no, you wanted to have numbers like 1 and 2, the second two arguments would not require quotes and would look like this:
 * NOTE:** When you want text displayed in a cell, you must put the text in quotes in the formula. If instead of yes and no, you wanted to have numbers like 1 and 2, the second two arguments would not require quotes and would look like this:

=IF(A2>B2,1,2)

You can put pretty much anything you like in the second two arguments. As shown above you can put text or a number. You can also tell Excel to leave the cell empty by using two quotes as your argument (“”). Let’s say we want “yes” if it’s true, but if it’s false, we want the cell left empty. Then our formula would look like this:

=IF(A2>B2,"yes","")

You can do all kinds of things with text in IF statements. Let’s say that we are evaluating the sales of our salespeople in order to see if they should get a raise or be fired. If last year’s sales are in A2 and this year’s sales are in B2, we can use an IF statement in C2 that says this:

=IF(A2>B2,”contact this salesperson”,”give this one a raise”)

Or, we can put cell references in the second two arguments. For example, if we want the value if false to be something that is in another cell, we can just put that cell name in the third argument. Let’s say, cell D2 contains a bonus amount, we could use this formula:

=IF(A2>B2,”contact this salesperson”,$D$2) || sources tech trax