Making decisions with IF
IF checks a condition and returns one thing when it's TRUE and another when it's FALSE.
=IF(logical_expression, value_if_true, [value_if_false])
The condition is usually a comparison:
| Operator | Meaning |
|---|---|
= | equal to |
<> | not equal to |
> / < | greater / less than |
>= / <= | greater / less than or equal to |
Text results go in double quotes: =IF(B2>=70, "Pass", "Fail"). To leave a cell looking empty, return an empty string "".
The results can be calculations too: =IF(B2>C2, B2*0.05, 0).