Using Excel Boolean Functions to Specify Complex Conditions

In the last lesson, we learned how to set simple logical conditions in Excel. In this lesson, we will continue the study, but we will try to complicate the task and use the logical functions of Excel to learn how to set more complex conditions.

So, in Excel there are 4 logical functions that allow you to set complex conditions. Let’s take a look at each of these functions:

Boolean function AND()

Returns TRUE if all conditions used are true, or FALSE if at least one of them is false.

=AND(A1>B1; A2<>25)

This formula tests two conditions at once and returns TRUE if both of them are true. In the following example, both conditions are true, so the function returns TRUE:

In this example, the first condition is false and the second condition is true, so the function returned FALSE:

Boolean OR() function

Returns TRUE if at least one of the conditions is true, or FALSE if all conditions are false.

=ИЛИ(A1>B1; A2>B2; A3>B3)

This formula tests three conditions and will return logical TRUE if at least one of them is true. In the example in the figure below, only the last condition is true, but this is enough for the function OR returned TRUE.

Since in this example all conditions are false, the function also returned FALSE.

Boolean function NOT()

Reverses the boolean value of its argument. If the argument is TRUE, the function changes it to FALSE. If the value of the argument is FALSE, then the function changes it to TRUE.

=NOT(A1>B1)

For example, in the following figure, you can see that the number in cell A1 is greater than the number in A2. Accordingly, the expression A1>B1 – has the logical value TRUE. By applying the NOT function in the formula, we changed it to the opposite.

Boolean function EXCLUDED()

Returns the logical exclusive or of all arguments. The function will return TRUE if the number of true conditions is odd, and FALSE if the number of true conditions is even. If all function arguments GLITTERED are FALSE, then the function will return FALSE.

=ИСКЛИЛИ(A1>B1; A2>B2; A3>B3; A4>B4)

In the following example, the formula will return TRUE because three of the four conditions are true (an odd number):

In this example, the formula will return FALSE because all 4 conditions are true (an even number):

In this example, the formula will return FALSE because none of the conditions are true:

In this lesson, you learned how to set complex conditions in Excel using logical functions. This knowledge should be enough for most of your tasks. Also, do not forget that you can nest logical functions into each other and get even more complex and confusing conditions. In fact, you probably won’t need it.

For those who are interested in the topic of logical functions, I suggest visiting the lesson Function IF in Excel using a simple example. I think this will be a logical continuation of this article. All the best to you and success in learning Excel.

Leave a Reply