*The tutorial shows how to write an IF OR statement in Excel to check for various "this OR that" conditions.*

IF is one of the most popular Excel functions and very useful on its own. Combined with the logical functions such as AND, OR, and NOT, the IF function has even more value because it allows testing multiple conditions in desired combinations. In this tutorial, we will focus on using IF-and-OR formula in Excel.

To evaluate two or more conditions and return one result if any of the conditions is TRUE, and another result if all the conditions are FALSE, embed the OR function in the logical test of IF:

IF(OR(*condition1*, *condition2*,...), value_if_true, value_if_false)

In plain English, the formula's logic can be formulated as follows: If a cell is "this" OR "that", take one action, if not then do something else.

Here's is an example of the IF OR formula in the simplest form:

`=IF(OR(B2="delivered", B2="paid"), "Closed", "Open")`

What the formula says is this: If cell B2 contains "delivered" or "cancelled", mark the order as "Closed", otherwise "Open".

In case you want to **return nothing** if the **logical test evaluates to FALSE**, include an empty string ("") in the last argument:

`=IF(OR(B2="delivered", B2="paid"), "Closed", "")`

Should the last argument be omitted, the formula would display FALSE when none of the conditions is met.

Below you will find a few more examples of using Excel IF and OR functions together that will give you more ideas about what kind of logical tests you could run.

There is no specific limit to the number of OR conditions embedded into an IF formula as long as it is in compliance with the general limitations of Excel:

- In Excel 2016 - 2007 formulas, up to 255 arguments are allowed, with a total length not exceeding 8,192 characters.
- In Excel 2003 and lower, you can use up to 30 arguments, and a total length shall not exceed 1,024 characters.

As an example, let's check columns A, B and C for blank cells, and return "Incomplete" if at least one of the 3 cells is blank. The task can be accomplished with the following IF OR function:

`=IF(OR(A2="",B2="", C2=""),"Incomplete","")`

And the result will look similar to this:

Looking for a formula that can do something more complex than return a predefined text? Just nest another function or arithmetic equation in the *value_if_true* and/or *value_if_false* arguments of IF.

Say, you calculate the total amount for an order (*Qty.* multiplied by *Unit price*) and you want to apply the 10% discount if either of these conditions is met:

- in B2 is greater than or equal to 10, or
*Unit Price*in C2 is greater than or equal to $5.

So, you use the OR function to check both conditions, and if the result is TRUE, decrease the total amount by 10% (B2*C2*0.9), otherwise return the full price (B2*C2):

`=IF(OR(B2>=10, C2>=5), B2*C2*0.9, B2*C2)`

Additionally, you could use the below formula to explicitly indicate the discounted orders:

`=IF(OR(B2>=10, C2>=5),"Yes", "No")`

The screenshot below shows both formulas in action:

As already mentioned, the Excel OR function is case-insensitive by nature. However, your data might be case-sensitive and so you'd want to run **case-sensitive OR tests**. In this case, perform each individual logical test inside the EXACT function and nest those functions into the OR statement.

IF(OR(EXACT(*cell,*"*condition1*"), EXACT(*cell,*"*condition2*")), value_if_true, value_if_false)

In this example, let's find and mark the order IDs "AA-1" and "BB-1":

`=IF(OR(EXACT(A2, "AA-1"), EXACT(A2, "BB-1")), "x", "")`

As the result, only two orders IDs where the letters are all capital are marked with "x"; similar IDs such as "aa-1" or "Bb-1" are not flagged:

In situations when you want to test a few sets of OR criteria and return different values depending on the results of those tests, write an individual IF formula for each set of "this OR that" criteria, and nest those IF's into each other.

To demonstrate the concept, let's check the item names in column A and return "Fruit" for *Apple* or *Orange* and "Vegetable" for *Tomato* or *Cucumber*:

`=IF(OR(A2="apple", A2="orange"), "Fruit", IF(OR(A2="tomato", A2="cucumber"), "Vegetable", ""))`

For more information, please see Nested IF with OR/AND conditions.

To evaluate various combinations of different conditions, you can do AND as well as OR logical tests within a single formula.

As an example, we are going to flag rows where the item in column A is either *Apple* or *Orange* and the quantity in column B is greater than 10:

`=IF(AND(OR(A2="apple",A2="orange"), B2>10), "x", "")`

For more information, please see Excel IF with multiple AND/OR conditions.

That's how you use IF and OR functions together. To have a closer look at the formulas discussed in this short tutorial, you are welcome to download our sample Excel IF OR workbook. I thank you for reading and hope to see you on our blog next week!

Excel formulas
Excel functions
Vlookup in Excel
Merge data in Excel
SumIf
Excel CountIf
Excel Compare
Excel If statement
Excel Charts
Pivot Table
Excel conditional formatting
Excel formatting
Excel time
Excel duplicates
Excel date
Excel tips
Excel macro
Outlook
Google Sheets
Outlook duplicates
Outlook templates

## 13 Responses to "Excel IF OR function with formula examples"

Hi there

please assist

if A>=2(Fail),if b>=3(Fail),but if A:B>=3(Fail)

How do i get this into one fomula

Very good article, thanks for sharing, Keep up the good work!

Hi. Can you help me. i have the following. Column Q is a sum of hours for operations. Column Y is my set hour reset. Y2 Starts at 120 hours and ends at Y23 at 2640 hours. increments are in 120 hours.

In Columm Q i have the following formula =Sum(K3+Q2). on R3 i want to add a formula to do the following.

If cell Q3 is 120240 then subtract Q3-$Y$2, or if Q3 is 241360 then Subtract Q3-$Y$3, or if Q3 is 361480 then subtract Q3-$Y$4, if false then add K3+Q2

Whats the best way for me to write it.

i manage to write a formula but it turns the cell in Column R when ever the statement is true "true".

Hello,

Thanks for your teach, but i think that is better to use brackets, especially if B2 can have several values

=IF(OR(B2={"delivered";"paid"});"Closed"; "")

instead

=IF(OR(B2="delivered", B2="paid"), "Closed", "Open")

Regards

Hi Victor,

I agree, this makes the formula more compact. Thanks for the tip!

=IF(OR(B2={"delivered";"paid"}),"Closed","") correct

I need the response in column D , labeled "link", to substitute the number of the column with the actual entry in that column of the row. The desired results, column E, are in the "want" column. Any thoughts?

1 2 3 LINK WANT

J18.9 A41.9 1 J18.9

R41.82 E86.0 E43 2 E86.0

G20 R26.89 G30.9 1,3 G20, G30.9

Hi everyone

I need little help to construct formula from below pseudo code.

If{

customer = private AND account_status = active AND account_open_date >23-June-2006

THAN

If {

risk = high

THAN

Last Review date = 1st review date + 6 Months

}

Else If{

risk = medium

THAN

Last Review date = 1st review date + 12 Months

}

Else If{

risk = low

THAN

Last Review date = 1st review date + 12 Months

}

Else {

last review date = 24-June-2006

}

}

If {

customer = govt AND account_open_date 23-June-2006

THAN

If {

risk = high

THAN

Last Review date = 1st review date + 6 Months

}

Else If {

risk = medium

THAN

Last Review date = 1st review date + 12 Months

}

Else If{

risk = low

THAN

Last Review date = 1st review date + 12 Months

}

}

If I want to reference three cells, what's the formula? (i.e =IF(F113-"x",(J126)),=IF(G113-"x",(K126)),=IF(H113-"x",(K126))

H126 want to be the value of one of three cells depending the selection of another value in three cells

Thanks in advance

If F34 value = "Dealer", then used values Column K OR

If F34 value = "Trade", then use values Column M OR

If F34 value = "End User", then use values Column

I am trying to evaluate if the first date is a weekend or the time is after 5pm.

Each works on its own but is not working when combines with the OR

I am getting #NAME?

=IF(OR(WEEKEND(E2,2)>5,K19>TIME(17,0,0)),"OT", "REG")

Any Ideas

Apparently I just needed to retype and press the keyboard harder:) it worked the 50th time I typed it I don't know why as it looks exactly the same. But for now I will move on.

Hi, Hoping someone can help.

I'm trying to write a formula using the IF, AND, or OR function but can't get the formula correct. It should be simple, really.

The conditions are;

If the SUM of Cells E4:G4 = between 10 and 15, then Cell G14 = 25

If the SUM of Cells E4:G4 is greater than or equal to 15, then Cell G14 = 50

Then there's one other result that I'm trying to achieve (in a separate cell but a similar formula)

If the SUM of Cells E4:P4 = between 400 and 600, then Cell P15 = 10

If the SUM of Cells E4:P4 is greater than or equal to 600, then Cell P15 = 20

I can't work out what I'm doing wrong, I wont paste what formulas i currently have to avoid causing a case of mass confusion.

THANKS IN ADVANCE