|
|
Condition - Function IF
Page visited 46489 times
|
1. The function IF make a logical test (TRUE or FALSE) on the value of a cells or the result of another formula. The function IF has 3 parameters : -The test -The result if the test is true -The result if the test is false
|
|
|
Formule de la cellule
=IF(logical condition; TRUE so ...; or FALSE so ....) |
|
|
|
|
|
|
|
2. We want to test the value of the average cell. If the average is greater than 10, the student is accepted, otherwise, he fails
|
|
|
Formule de la cellule
=IF(E2>=10;"Accepted";"Failed") |
|
|
|
|
|
|
|
|
3. You can write the same formula with a different logical test and of course, you must change the order of your wording
|
|
|
|
|
|
|
|
|
4. The following array displayed the different logical operator that you'll use for your test
|
|
|
|
|
|
|
|
|
5. You can write the formula but with the average function as criteria and not the cell E2 where the result is
|
|
|
Formule de la cellule
=IF(AVERAGE(B2:D2)>=10;"Pass";"Faied") |
|
|
|
|
|
|
|
|
6. Now, you just want to display the student "Pass". So you write your function with just the TRUE criteria
And you have the following result
|
|
|
Formule de la cellule
|
|
|
|
|
|
|
|
7. So, avoid this result, we write an empty result for the FALSE result.
It is not a 0, it is not a space, it is 2 double-quote
|
|
|
Formule de la cellule
|
|
|
|
|
|
|
|
|