Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

Excel OR function

The OR function in Excel is used to test multiple conditions at the same time, if any one of the conditions is met, a TRUE is returned, if none of the conditions is met, a FALSE is returned. The OR function can be used in combination with the AND and IF functions together.

doc or function 1


 Syntax:

The syntax for the OR function in Excel is:

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

 Arguments:

  • Logical1: Required. The first condition or logical value that you want to test.
  • Logical2: Optional. The second condition or logical value to evaluate.

Notes:

  • 1. The arguments must be logical values such as TRUE or FALSE, or in arrays or references that contain logical values.
  • 2. If the specified range contains no logical values, OR function returns the #VALUE! error value.
  • 3. In Excel 2007 and later versions, you can enter up to 255 conditions, in Excel 2003, only handle up to 30 conditions.

 Return:

Test multiple conditions, return TRUE if any one of arguments is met, if not, return FALSE.


 Examples:

Example 1: Use OR function only

Let’s take the below data for example:

doc or function 1

Formula Result Description
Cell C4: =OR(A4,B4) TRUE Displays TRUE because the first argument is true.
Cell C5: =OR(A5>60,B5<20) FALSE Displays FALSE because both criteria do not match.
Cell C6: =OR(2+5=6,20-10=10,2*5=12) TRUE Displays TRUE because the condition “20-10” is matching.

Example 2: Use OR and AND functions together in one formula

In Excel, you may need to combine the AND and OR function together for solving some problems, there are some basic patterns as follows:

  • =AND(OR(Cond1, Cond2), Cond3)
  • =AND(OR(Cond1, Cond2), OR(Cond3, Cond4)
  • =OR(AND(Cond1, Cond2), Cond3)
  • =OR(AND(Cond1,Cond2), AND(Cond3,Cond4))

For example, if you want to know the Product which are KTE and KTO, the order of KTE is greater than 150, and the order of KTO is greater than 200.

Please use this formula, and then drag the fill handle to the cells you want to apply this formula, and you will get the result as below screenshot shown:

=OR(AND(A4="KTE", B4>150), AND(A4="KTO", B4>200))

doc or function 2


Example 3: Use OR and IF functions together in one formula

This example helps you to understand the combination of OR and IF functions. For example, you have a table contains the students’ test score, if one of the subjects is greater than 60, the student will pass the final exam, otherwise, fail the exam. See screenshot:

doc or function 3

To check if the student passes the exam or not, using the IF and OR functions together to solve it, please use this formula:

=IF((OR(B2>=60, C2>=60)), "Pass", "Fail")

This formula indicates that, it will return Pass, if any a value in column B or column C is equal or greater than 60. Otherwise, the formula returns Fail. See screenshot:

doc or function 4

Click for knowing more about IF function…


Example 4: Use OR function as array form

If we you OR as an array formula, you can test all values in a specific range against a given condition.

For example, if you want to check if there are values in a range are greater than 1500, please use the below array formula, and then press Ctrl +Shift + Enter keys together, it will return TRUE if any cell in A1:C8 is greater than 1500, otherwise, FALSE is returned. See screenshot:

=OR(A1:C8>1500)

doc or function 5


Excel Productivity Tools

300 Advanced Features Help You To Stand Out From Crowd

Would you like to complete your daily work quickly and perfectly? Kutools for Excel brings 300 powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) and save 70% time.

  • Designed for 1500 work scenarios, helps you solve 80% Excel problems.
  • Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands.
  • Become an Excel expert in 3 minutes. No longer need to remember any painful formulas and VBA codes.
  • 60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years.

Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • Office Tab Increases your productivity by 50% when viewing and editing multiple documents.
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • One second to switch between dozens of open documents!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.

Be the first to comment.