

In practice, a seemingly correct IF / AND formula may result in an error because of this specificity. Such behavior is a bit unusual since in most of programming languages, subsequent conditions are not tested if any of the previous tests has returned FALSE. Microsoft Excel checks all conditions in the AND function, even if one of the already tested conditions evaluates to FALSE. The screenshot below proves that our Excel IF /AND function is correct:

=IF((AND(C2>=20, D2>=30)), "Pass", "Fail")Įasy, isn't it? The formula tells Excel to return "Pass" if a value in column C >=20 AND a value in column D >=30. The easiest way to make a proper formula is to write down the condition first, and then incorporate it in the logical_test argument of your IF function: Only when both of the above conditions are met, a student passes the final exam. The second score, listed in column D, must be equal to or exceed 30. The first score, stored in column C, must be equal to or greater than 20. Suppose, you have a table with the results of two exam scores. To better illustrate the point, let's have a look at a few IF examples with multiple conditions.

In case you use the OR function in the logical test, Excel returns TRUE if any of the conditions is met FALSE otherwise. If your logical test contains the AND function, Microsoft Excel returns TRUE if all the conditions are met otherwise it returns FALSE. Consequently, your IF function should embed an AND or OR function in the logical test, respectively. In summary, there can be 2 basic types of multiple conditions - with AND and OR logic.
Excel student discount how to#
How to use Excel IF function with multiple conditions
