Excel Logical test

A logical test in Excel (logical expression) returns only two types of values: TRUE or FALSE.

Table of contents:

  1. What is a logical test?
  2. Steps to create a logical test
  3. Logical operators in logical test
  4. Conditional formatting formulas

What is a logical test?

For example, if you want to test that cell B3 is equal to the string “Product”, use the following formula:


simple logical test TRUE or FALSE

The formula has two outputs: TRUE or FALSE.

Steps to create a logical test

  1. Type an equal sign (=)
  2. Enter the first value or use a cell reference
  3. Select a logical symbol that you want to use for comparison
  4. Select the cell that contains the second value

That’s all.

Logical operators in logical test

List of the logical operators:

  • = equal to
  • > greater than
  • >= greater than or equal to
  • < less than
  • <= less than or equal to
  • <> not equal

Sometimes, we use multiple logical tests in Excel formulas. Depending on your task, your formula may contain different logical tests. For example, to test if cell B8 is greater than 10 AND less than 20, you can use a formula like this: =AND(B8>10, B8<20). In this case, the formula returns TRUE or FALSE also.

Conditional formatting formulas

A logical test is important in working with conditional formatting to highlight cells or ranges. In the example below, you want to highlight cells based on criteria. If the value in a range is greater than 40, apply the green fill.

conditional formatting logical test

Al logical tests work based on Boolean logic. Take a closer look at it!

Additional resources:

Istvan Vozar

Istvan is the co-founder of Visual Analytics. He helps people reach the top in Excel.