Logical Operators in Excel

What Are Logical Operators In Excel?

The Logical Operators in Excel are used to compare multiple cell values in a given dataset. The values can be numeric, text, or strings. The result will always be TRUE or FALSE, respectively, if the given Logical Operators fulfill the condition or not.

List Of Logical Operators In Excel

The Logical Operators in Excel are given below in the table, along with its symbol and description.

SNOperatorsNameDescription
 1=Equal toCompare one value to another value.
 2<> Not Equal toTest whether the value is not equal to a value or not.
 3Greater thanTest whether the value is greater than a value or not.
 4Less thanTest whether the value is less than a value or not.
 5>=Greater than or equal toTest whether the value is greater than or equal to a value.
 6<=Less than or equal toTest whether the value is less than equal to a value.

 Let us consider each Logical Operator with specific examples.

Operator #1 – Equal to (=) to compare two values

The succeeding example depicts the values, and we will calculate the result of the given values using the Equal to (=) to compare two values.

In the table, the data is,

  • Column A contains Value 1.
  • Column B contains Value 2.
  • Column C displays the Output.
Logical Operators in Excel - Operator 1

The steps to calculate the value using the Equal to (=) operator are as follows:

1: Select cell C2, and enter the formula =A2=B2.

Logical Operators in Excel - Operator 1 - Step 1

2: Press the “Enter” key. The result is ‘TRUE’, as shown below.

Logical Operators in Excel - Operator 1 - Step 2

3: Drag the formula from cell C2 to C6 using the excel fill handle. The output is shown below.

Logical Operators in Excel - Operator 1 - Step 3

Operator #2 – Not Equal to (<>) to compare two values

The succeeding example depicts the values, and we will calculate the result of the given values using the Not Equal to (<>) to compare two values.

In the table, the data is,

  • Column A contains Value 1.
  • Column B contains Value 2.
  • Column C displays the Output.
Logical Operators in Excel - Operator 2

The steps to calculate the value using the Not Equal to (<>) operator are as follows:

1: Select cell C2, and enter the formula =A2<>B2.

Logical Operators in Excel - Operator 2 - Step 1

2: Press the “Enter” key. The result is ‘TRUE’, as shown below.

Logical Operators in Excel - Operator 2 - Step 2

3: Drag the formula from cell C2 to C5 using the fill handle. The output is shown below.

Logical Operators in Excel - Operator 2 - Step 3

Operator #3 – Greater than (>) to compare two values

The succeeding example depicts the values, and we will calculate the result of the given values using the Greater than (>) to compare two values.

In the table, the data is,

  • Column A contains Value 1.
  • Column B contains Value 2.
  • Column C displays the Output.
Logical Operators in Excel - Operator 3

The steps to calculate the value using the Greater than (>) operator are as follows:

1: Select cell C2, and enter the formula =A2>B2.

Logical Operators in Excel - Operator 3 - Step 1

2: Press the “Enter” key. The result is ‘TRUE’, as shown below.

Logical Operators in Excel - Operator 3 - Step 2

3: Drag the formula from cell C2 to C5 using the fill handle. The output is shown below.

Logical Operators in Excel - Operator 3 - Step 3

Operator #4 – Less than (<) to compare two values

The succeeding example depicts the values, and we will calculate the result of the given values using the Less than (<) to compare two values.

In the table, the data is,

  • Column A contains Value 1.
  • Column B contains Value 2.
  • Column C displays the Output.
Logical Operators in Excel - Operator 4

The steps to calculate the value using the Less than (<) operator are as follows:

1: Select cell C2, and enter the formula =A2<B2.

Logical Operators in Excel - Operator 4

2: Press the “Enter” key. The result is ‘TRUE’, as shown below.

Logical Operators in Excel - Operator 4 - Step 2

3: Drag the formula from cell C2 to C5 using the fill handle. The output is shown below.

Logical Operators in Excel - Operator 4 - Step 3

Operator #5 – Greater than Equal to (>=) to compare two values

The succeeding example depicts the values, and we will calculate the result of the given values using the Greater than Equal to (>=) to compare two values.

In the table, the data is,

  • Column A contains Value 1.
  • Column B contains Value 2.
  • Column C displays the Output.
Logical Operators in Excel - Operator 5

The steps to calculate the value using the Greater than Equal to (>=) operator are as follows:

1: Select cell C2, and enter the formula =A2>=B2.

Logical Operators in Excel - Operator 5 - Step 1

2: Press the “Enter” key. The result is ‘TRUE’, as shown below.

Logical Operators in Excel - Operator 5 - Step 2

3: Drag the formula from cell C2 to C5 using the fill handle. The output is shown below.

Logical Operators in Excel - Operator 5 - Step 3

Operator #6 – Less than Equal to (<=) to compare two values

The succeeding example depicts the values, and we will calculate the result of the given values using the Less than Equal to (<=) to compare two values.

In the table, the data is,

  • Column A contains Value 1.
  • Column B contains Value 2.
  • Column C displays the Output.
Logical Operators in Excel - Operator 6

The steps to calculate the value using the Less than Equal to (<=) operator are as follows:

1: Select cell C2, and enter the formula =A2<=B2.

Logical Operators in Excel - Operator 6 - Step 1

2: Press the “Enter” key. The result is ‘TRUE’, as shown below.

Logical Operators in Excel - Operator 6 - Step 2

3: Drag the formula from cell C2 to C5 using the fill handle. The output is shown below.

Logical Operators in Excel - Operator 6 - Step 3

Logical Operators in Excel with IF Function

We can also use the IF function with the Logical Operators, as shown in the examples below.

Example #1

The succeeding example depicts the values, and we will calculate the result of the given values using the Excel IF function with the Greater than equal to Operator.

In the table, the data is,

  • Column A contains Value 1.
  • Column B contains Value 2.
  • Column C displays the Output.
Logical Operators in Excel - Example 1

The procedure to calculate using the IF() and Greater than equal to Operator are as follows:

  • Select cell C2,
  • Enter the formula =IF(A2>=B2,TRUE,FALSE),
  • Press the “Enter” key, and
  • Drag the formula from cell C2 to C5 using the fill handle.
Logical Operators in Excel - Example 1 - Output

The output is shown above.

Example #2

The succeeding example depicts the values, and we will calculate the result of the given values using the Excel IF function with the Less than Operator in Excel.

In the table, the data is,

  • Column A contains Value 1.
  • Column B contains Value 2.
  • Column C displays the Output.
Logical Operators in Excel - Example 2

The procedure to calculate using the IF() and the Less than operator are as follows:

  • Select cell C2,
  • Enter the formula =IF(A2<B2,TRUE,FALSE),
  • Press the “Enter” key, and
  • Drag the formula from cell C2 to C5 using the fill handle.
Logical Operators in Excel - Example 2 - Output

The output is shown above.

Download Template

This article must help understand the Logical Operator in Excel’s formula and examples. You can download the template here to use it instantly.

This has been a guide to Logical Operators In Excel. Here we compare data, with equal/not equal, greater/lesser than, examples & downloadable excel template. You may learn more from the following articles –

Reader Interactions

Leave a Reply

Your email address will not be published. Required fields are marked *