OR function

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

Example

Examples of using the OR function.

Technical Details

Examples

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

FormulaDescription
=OR(A2>1,A2<100)Displays TRUE if A2 is greater than 1 OR less than 100, otherwise it displays FALSE.
=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”.
=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.

Sales Commission Calculation

Here is a fairly common scenario where we need to calculate if sales people qualify for a commission using IF and OR.Example of using IF and OR to calculate sales commission.

  • =IF(OR(B14>=$B$4,C14>=$B$5),B14*$B$6,0) – IF Total Sales are greater than or equal to (>=) the Sales Goal, OR Accounts are greater than or equal to (>=) the Account Goal, then multiply Total Sales by the Commission %, otherwise return 0.

Leave a Comment

Your email address will not be published. Required fields are marked *