How to Use the OR Function in Excel – 4 Examples

Thr Excel OR Function

The OR function tests conditions and returns a boolean value.

OR Function in Excel

  • Objective

Checks whether the arguments are TRUE, and returns TRUE or FALSE.

  • Syntax

=OR(logical1,[logical2], ...)

  • Arguments
Argument Required/Optional Explanation
logical1 Required The first condition or logical value to evaluate.
[logical2] Optional The second condition or logical value to evaluate.
  • Returning Parameter

Logical values- TRUE or FALSE, depending on whether at least one of the logical arguments is TRUE .


Example 1 – Using the Basic OR Function in Excel

This is the sample dataset.

Sample Dataset for Basic OR Function in Excel

To fill the remarks column:

Steps:

  • Select E5.
  • Enter the following formula:

=OR(C5>70,D5=100)

  • Press Enter.

Basic OR Function in Excel

  • Select the cell again.
  • Drag down the Fill Handle to see the result in the rest of the cells.

The formula checks whether the score in English is greater than 70 or the Math score is equal to 100. It returns TRUE. if the are met. Otherwise, FALSE.


Example 2 – Combining the OR and the IF Functions

Steps:

  • Select E5.
  • Enter the following formula:

=IF(OR(C5>70,D5=100),"Did Well","Failed")

  • Press Enter.

Combination of OR and IF Function in Excel

  • Select the cell again.
  • Drag down the Fill Handle to see the result in the rest of the cells.

The IF function can take three arguments- a condition, a value to return if the condition is TRUE, and a value to return otherwise.


Example 3 – Use the OR function with a Range in Excel

This is the sample dataset.

Sample Dataset for Apply OR for a Range in Excel

Steps:

  • Select E5.
  • Enter the following formula:

=OR(C5:D5>=5)

  • Press Enter.

  • Select the cell again.
  • Drag down the Fill Handle to see the result in the rest of the cells.

 


Example 4 – Combining the OR and the AND Function

This is the sample dataset.

To find Thriller or Action films in English:

Steps:

  • Select D5.
  • Enter the following formula:

=AND(C5="English",OR(B5="Thriller",B5="Action"))

  • Press Enter.

Combine OR with AND Function in Excel

  • Select the cell again.
  • Drag down the Fill Handle to see the result in the rest of the cells.

 


Things to Remember

  • Do not use comparison operators or insert text values in the OR function. It will return a #VALUE error.

Download Practice Workbook

Download the workbook.

 


<< Go Back to Excel Functions | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Shakil Ahmed
Shakil Ahmed

My name’s Shakil. My articles are targeted to support you in enriching knowledge regarding different features related to Microsoft Excel. I am fond of literature, hope some knowledge from them will help me providing you some engaging articles even though some weary technical terms.

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo