Excel OR() Function

The OR() function in excel tests the multiple sets of conditions and returns TRUE if any of the arguments are TRUE and FALSE if all the arguments supplied do not meet the criteria. You need to have a minimum of 2 conditions to check.

Syntax

OR (Logical 1, Logical 2, Logical 3, and soon..)

Parameter

Logical1 (required)- This parameter represents the first condition that needs to be checked.

Logical 2(optional)- This parameter represents the second condition which needs to be checked.

….(optional)- It represents the other conditions, that need to be checked.

Category

Logical

Return

The function returns TRUE value even if one of the conditions holds else returns a FALSE value. Basically, for a FALSE to appear, no conditions should hold.

Example 1

Objective: Test condition 1 and condition 2 to check whether the numbers are greater than 0 or not by using the OR function.

Condition 1 Condition 2 Result Formula
11 23 TRUE  =OR(A20>0,B20>0)
-1 -2 FALSE  =OR(A21>0,B21>0)
-1 2 TRUE  =OR(A22>0,B22>0)

Example 2

Objective: Return TRUE if COL A is greater than COL B and COL B is less than COL C

Col A Col B Col C Result Formula
167 502 61 FALSE =OR(B141>C141,C141<D141)
903 895 967 TRUE =OR(B142>C142,C142<D142)

Example 3

Objective: Using IF and OR function, check whether the student has passed or not. If the student has failed in 1 of the 2 subjects, then the student will be considered as Failed.

Student Name Subject 1 Subject 2 Overall Result Formula
Reeta PASS PASS PASS  =IF(OR(B28="FAIL",C28="FAIL"),"FAIL","PASS")
Sweta PASS FAIL FAIL  =IF(OR(B29="FAIL",C29="FAIL"),"FAIL","PASS")
Baani FAIL PASS FAIL  =IF(OR(B30="FAIL",C30="FAIL"),"FAIL","PASS")
Aditya PASS PASS PASS  =IF(OR(B31="FAIL",C31="FAIL"),"FAIL","PASS")



ADVERTISEMENT
ADVERTISEMENT