How to Use The IF and OR Functions Together in Excel
The IF function in Excel is the most commonly used when you want to create a conditional formula but itโs usually a very basic condition ๐ค
To create a more complex condition, we combine IF with logical functions like OR. This lets you make decisions based on multiple criteria in a seemingly easy way ๐ง
In this tutorial, we will see the IF and OR functions in action. To practice along the guide, download our free sample workbook here. That being said, letโs get right into it.
IF OR functions in Excel
OR is a logical function and works with two values TRUE and FALSE. The OR function returns a TRUE value when at least one of the given conditions is true โ
This means if you have a value in cell A2, say, 10, and you apply OR conditions to it as A2 > 15 or A2 = 10, the OR function will return TRUE. Thatโs because the second condition is true for cell A2.
The syntax of the OR function is given as:
where,
logical1 refers to the condition you want to check
Even though you can use the OR function on its own, it would only return TRUE or FALSE. It becomes twice as powerful and customizable as you combine it with the Excel IF function.
You can use logical functions with conditional formatting if you want to format cells to return different results ๐ค
But if you want the function to return a text string, empty string, numbers, or result of an expression, IF is your go-to function.
The syntax of IF and OR combined is given as below:
where,
condition1 refers to the logical test youโre putting up
value_if_true refers to the value to be returned if the condition is true
value_if_false refers to the value to be returned if the condition is false
The logic of an IF and OR combined function is such that it checks multiple conditions and if any one of these conditions is fulfilled, it will display the value of the true argument otherwise the value of the false argument โ
IF OR function examples
Letโs see some example cases for the IF and OR functions to understand how they work together.
Comparison test
Say, we have the following sample data of a class containing a studentโs grades in different subjects ๐
We want to check if he has passed these subjects or not where the passing criteria is to have obtained more than 50% in the said subject.

To do that we will follow a step-by-step process:
Step 1) Select cell C2 in column C.
Step 2) Type in the following formula:
Make sure to insert closing parenthesis for OR and IF at the end of the formula.
Step 3) Press Enter.

The function returns the result as Pass which is correct. To get the formula for the other value in column B, double-click the Fill Handle to copy the formula down ๐ฝ

And itโs done! How easy was that? ๐
IF with multiple OR functions
You can incorporate as many OR conditions in your Excel formulas as you want as long as it doesnโt cross the 255 conditions limit.
However, it is not recommended to use too many because a complex nested OR formula becomes difficult to debug and maintain ๐
Letโs use the following example for this case.
Say, we have a sample dataset where some items are being shipped. We want any order thatโs not in the delivered category to be labelled complete while all others are incomplete โ

To do this,
Step 1) Select cell C2.
Step 2) Type in the following formula:
Step 3) Press Enter.

To copy the formula down the remaining cells, simply double-click the Fill Handle โ

IF OR formula with case-sensitivity
We just saw that the OR function is case-insensitive so what do you do if your data is case-sensitive? You couple it with the EXACT function ๐
We will write all our conditions inside the EXACT function and then nest it all in the OR function.
The syntax for IF OR with EXACT is given as follows:
where,
cell refers to the cell reference containing the value
condition1 refers to the OR logical test to be checked
Letโs now see an example where IF OR and the EXACT function are working together.
Say, we have the following sample data where we have some product codes. A couple of these have been repeated by mistake but we only want CO-1 and MT-3.
So we will write a function that returns โFoundโ when the code is in the same otherwise โNot foundโ โ

To do that,
Step 1) Select cell B2.
Step 2) Type in the following formula:
Step 3) Press Enter.

Copy the above formula down the remaining cells using the Fill Handle.

The formula checks for the exact match and then returns Found and not found if even a single character is different from the string given.
Cool, no? ๐
Return calculated result with IF OR
The IF formula also offers the luxury of returning calculated values in the true or false values. This adds an element of personalization as you are no longer restricted to text strings only ๐งต
Letโs see an example of this case.
Say, you have the following sample data. It contains a list of salaries of a companyโs employees. If the salary of an employee is above a certain threshold, he will be charged 10% tax. If not, then no tax.

To do this,
Step 1) Select cell B2.
Step 2) Type in the following formula:
Step 3) Press Enter.

Copy the formula down to the remaining cells by double-clicking the Fill Handle.

Voila! Itโs done. The function calculates a 10% tax on salaries that exceed the 30000 threshold and returns a โNo taxโ text string for the values below the threshold.
How easy is that? Give it a try now ๐ง
Nested IF OR example
Sometimes, you might need to get specific results for specific conditions all in one formula. In such cases, we use the nested If OR function.
It might look complicated but in actuality, it makes everything rather simple. Letโs see a simple example of it below ๐ฝ
Say, we have the following sample data below. We want the function to check if a product lies in a certain category, if not then check for it in another category and display that.

To do that,
Step 1) Select cell B2.
Step 2) Type in the following formula:
Step 3) Press Enter.

Copy the formula down the remaining cells

And itโs done.
the function will now return Beverage when it finds the word Coffee or Water and Stationary when it spots Books or Pencil.
Pretty cool, no? ๐
IF OR with AND Logical function
You can also use AND and OR with IF functions to construct complicated functions for a specific problem. AND function returns TRUE only when all the conditions are true.
Letโs see an example below that involves IF AND OR functions.
We have the following sample data, where we want to check if sales are made by Ali or Henry and if the sales exceed $1000 ๐ฒ๐ฒ

To do that,
Step 1) Select cell C2.
Step 2) Type in the following formula:
Step 3) Press Enter.

Copy the formula down the remaining cells by dragging down the Fill Handle or double-clicking it.

The functions return the result as expected.
The logic of this function is that it starts from the OR function and checks if the cell value is Ali or Henry, if true then it checks if the value in cell B2 is greater than 1000 or not.
If both conditions return true, the function returns Check, otherwise Uncheck. This also proves the classic AND behaviour that when in a function, it returns true only when all the conditions are true.
See how that simplifies things? Try it yourself now! ๐
Conclusion
In this Excel tutorial, we saw how to use IF and OR functions in combination we each other. We saw different use cases and methods in which you can use the IF and OR functions.
We also used the AND function with IF and OR to evaluate different combinations in one go. If you want to read more about IF OR or AND functions, read the articles below ๐งพ
How to Use the IF Function in Excel: Step-by-Step (2024)
How to Use the IF and AND Functions in Excel (Examples)
Excel AND + OR Functions: Full Guide (with IF Formulas)
We hope you enjoyed reading this article as much as we did creating it ๐ค