How to use IF with OR function..?
In our previous post IF with AND formula for multiple logical tests is explained with the example. Similarly, instead of using AND function we can use OR function for testing multiple logical tests to give the results.
OR Function:
In OR logic, different logical test can be done, this function will check all conditions and returns TRUE if any condition ia correct and FALSE if all of the logical test fails.
In above example it will check whether B5 is greater than 1 , B6 is greater than 2 and B7 is greater than 3, if any one or more conditions are correct it will give the result TRUE.
This OR function can be used with IF to get the customised result instead of TRUE of FALSE. When IF function is used the result can be a constant, a cell reference or a formula result.
Syntax for IF with OR function:
=IF(OR(LOGICAL1,LOGICAL2),OUTPUT IF TRUE,OUTPUT IF FALSE)
In OR function you can give up to 256 logical tests.
This combination of IF OR formula is explained with one example.
In this example the marks obtained by the student in 6 subject is checked and result is given whether Pass or Fail
If the student obtains 40 or more marks in each subject and the total marks obtained is 300 or more then the result is Pass.
If the student obtains less than 40 marks in any of the subject and total is less than 300 then the result is Fail.
To check this following IF and OR function combined formula is used.
The formula will check marks of all 6 subject and also the total marks with OR function and it will check whether the marks is less than 40 in any subject, if result is true the formula will give the output of Fail, else it will give the output of Pass.
If you find any difficulty in applying this formula, you can comment.
Related Functions:
- IF with AND formula for multiple logical tests.
- IF FUNCTION AND NESTED IF FORMULAS IN EXCEL
- SUMIFS Functions in Excel
- SUMIF Functions in Excel
Comments
Post a Comment