![]()
The IF function will check the logical condition of a statement and return one
value if true and a different value if false. The value returned may be either
a number or text. If the value returned is text, it must be in quotes The syntax
for the IF function is:
=IF (condition, value-if-true, value-if-false)
For instance, if we have the following data set given above, the IF function would be:
=IF(E4>179,"Pass","Fail")
The above example demonstrates how the IF function is used to give us one value (Pass) if the student is passing the class, and another value (Fail) if the student is in danger of failing the course. There are many more ways in which the IF function could be used. This is only one example.
To perform an IF function like the example above, follow the steps below: