Logical Operators in Excel

Last Updated :

-

Edited by :

Reviewed by :

Table Of Contents

arrow

List of Logical Excel Operators

Logical operators in Excel are also known as comparison operators. They are used to compare two or more values. The return output given by these operators is either TRUE or FALSE. We get a TRUE value when the conditions match the criteria and FALSE as a result when the conditions do not match the criteria.

Below are the most commonly used logical operators in Excel.

Now we will look at each one of them in detail.

Sr No.Logical Operator Excel SymbolOperator NameDescription
1=Equal toCompares One Value to Other Value
2>Greater ThanTests whether the value is greater than a certain value or not
3<Less ThanTests whether the value is less than a certain value or not
4>=Greater Than or Equal ToTests whether the value is greater than or equal to a certain value or not   
5<=Less Than or Equal ToTests whether the value is less than or equal to a certain value or not 
6<>Not Equal ToTests whether a particular value is not equal to a certain value or not 

#1 Equal Sign (=) to Compare Two Values

We can use the equal sign (=) to compare one cell value against the other cell value. In addition, we can compare all types of values using an equal sign. For example, assume we have the below values from cells A1 to B5.

Excel Logical Operators - Step 1

Now, we want to test whether the value in cell A1 is equal to cell B1's value.

  1. To select the value of A1 to B1, let us open the formula with an equal sign.


    Excel Logical Operators - Step 2

  2. Now, select cell A1.


    Excel Logical Operators - Step 3

  3. Now, type the one more logical operator symbol equal sign (=).


    Excel Logical Operators - Step 4

  4. Now, select the second cell we are comparing, the B2 cell.


    Excel Logical Operators - Step 5

  5. Press the "Enter" key to close the formula. Then, we must copy and paste it into other cells.


    Excel Logical Operators - Step 6

    So, we get "TRUE'' as a result if the cell 1 value is equal to cell 2 or we get "FALSE."

#2 Greater Than (>) Sign to Compare Numerical Values

Unlike equal sign (=) greater than sign (>) can only test numerical values, not text values. So, for example, if the values are in cells A1 to A5 and we want to try whether these values are greater than (>) the value of 40 or not.

Greater Than Step 1
  • Step 1: We must first open the formula in the B2 cell and select cell A2 as the cell reference.
Greater Than Step 2
  • Step 2: Since we are testing, the value is greater than the mention > symbol and apply the condition as 40.
Greater Than Step 3
  • Step 3: Now, close the formula and use it to remain cells.
Greater Than Step 4

Only one value is >40, i.e., cell A3 value.

Cell A6 value is 40; since we have applied the logical operator > as the criteria formula returned, the result is FALSE. We will see how to solve this issue in the next example.

#3 Greater Than or Equal To (>=) Sign to Compare Numerical Values

In the previous example, the formula returns a TRUE value only to those greater than the criteria value. But if the criteria value is also included in the formula, we need to use the >= symbol.

Greater Than or Equal To

The previous formula excluded the value of 40, but this formula included.

#4 Less than Sign (<) to Compare Numerical Values

Like how greater than tests the numerical values are, similarly less than also tests the numbers. We have applied the formula as <40.

Less than Step 1

It works opposite to the greater than criteria. It has returned TRUE to all those values that are less than 40.

Less than Step 2

#5 Less Than or Equal To Sign (<=) to Compare Numerical Values

Like how >= sign includes the criteria value in the formula similarly, <= also performs the same way.

Less Than or Equal To step 1

This formula had the criteria value, so the value of 40 is returned as TRUE.

Less Than or Equal To step 2

#6 Not Equal Sign (<>) to Compare Numerical Values

Combination of greater than (>) and less than (<) signs make the operator sign not equal to <>. It works opposite to an equal sign. The equal sign (=) tests whether the one value is equal to the other value and returns TRUE, whereas not equal to sign <> returns TRUE if the one value is not equal to another value and returns FALSE if the one value is not equal to another one.

Not Equal Sign Step 1

As we said, A3 and B3 cell values are the same, but the formula returns FALSE, which is completely different from the EQUAL sign logical operator.

Not Equal Sign Step 2

Logical Operator in Excel with Formulas

We can also use logical operator symbols in other Excel formulas IF Excel function is one of the often used formulae with logical operators.

#1 - IF with Equal Sign

Suppose the function tests whether the condition is equal to a certain value or not. If the value is equal, then we can have our value. Below is a simple example of that.

IF with Equal Sign 1

The formula returns the Same if the cell A2 value is equal to the B2 value; if not, it will return Different.

IF with Equal Sign 2

#2 - IF with Greater Than Sign

We can test certain numerical values, arrive at results if the condition is TRUE, and return a different result if the condition is FALSE.

IF with Greater Than

#3 - IF with Less Than Sign

The below formula will show the logic of applying if with less than the logical operators.

IF with Less Than Sign

Things to Remember

  • Excel logical operator symbols return only TRUE or FALSE.
  • Combination of > & < symbols do not equal sign <>.
  • >= & <= sign includes the criteria also in the formula.