How to use OR function in excel?

Use the OR function, one of the logical functions, to determine if any conditions in a test are TRUE.

Condition-1 If all arguments are TRUE then we will get TRUE in the result.

Condition-2 If one argument is FALSE then we will get TRUE in the result.

Condition-3 If all arguments are FALSE then we will get FALSE in the result.

Conclusion

If all arguments are  FALSE then only we will get FLASE in the result otherwise we will get always TRUE in the result.

Syntax

OR(logical1, [logical2], …)

Examples

Here are some general examples of using OR by itself, and in conjunction with IF

Let’s check all three conditions mentioned above 

Conditions

Condition-1

 =OR(A2>1, A2<100)   Displays TRUE if A2 is greater than 1 OR less than 100, otherwise it displays FALSE.

Now we can take some examples with IF condition 

Condition 2 

                      =IF(OR(A2>1,A2<100),A3,”The value is out of range”)

  Displays the value in cell A3 if it is greater than 1 OR less than 100, otherwise, it displays the message “The value is out of range”.otherwise it displays FALSE.

Condition 3

=IF(OR(A2<0,A2>50),A2,”The value is out of range”)

 Displays the value in cell A2 if it’s less than 0 OR greater than 50, otherwise, it displays a message.

You may also Like

By admin

Leave a Reply

Your email address will not be published.