There are many different functions in Excel that work based on checking logical conditions. For example, these are the functions IF, COUNTIF, SUMIF, etc. Also, logical conditions can be set in the usual formulas, if you need to get an affirmative answer: Yes or No. For example, by asking simple logical conditions, you can answer questions like:
- 5 more than 8?
- Is the content of cell A5 less than 8?
- Maybe equal to 8?
Comparison Operators in Excel
Excel has a number of standard operators that are used to set simple logical conditions. All six possible comparison operators are shown in the table below:
How to set a condition in Excel
Comparison operators allow you to specify conditions that return the boolean values TRUE or FALSE. Examples of the use of logical conditions are presented below:
=A1=B1 — This condition will return TRUE if the values in cells A1 and B1 are equal, or FALSE otherwise. By specifying this condition, you can compare text strings case-insensitively. For example, comparing “JANUARY” and “JANUARY” the formula will return TRUE.
=A1>B1 – The following formula will return TRUE if the value of cell A1 is greater than that in B1. Otherwise, the formula will return FALSE. Such comparisons can also be set when working with text.
For example, if cell A1 contains “Orange” and B1 contains “Watermelon”, then the formula will return FALSE because “Watermelon” is alphabetically lower than “Orange”. The lower, the more.
=A1<=B1 – The formula will return TRUE if the value of cell A1 is less than or equal to the value in cell B1. Otherwise, the result will be FALSE.
=A1<>B1 – The formula will return TRUE if the values of cells A1 and B1 are not equal. Otherwise, FALSE.
Excel has logical functions THE TRUTH() и FALSE(), which have no arguments. These functions exist primarily for compatibility with other spreadsheets. You can enter TRUE and FALSE values directly into cells or formulas without using the function entry form, Excel will understand everything perfectly.
If you are sure that you have already mastered this topic well enough, you can refer to the article Use Excel Boolean Functions to Specify Complex Conditions to learn how to specify conditions using various Boolean functions, for example I() or OR().