Excel: Use an IF Function with 2 Conditions

Excel is an invaluable tool for businesses and individuals alike. It is a powerful, versatile program that can be used to store, organize, and analyze data. One of the most useful functions in Excel is the IF function, which allows users to test two conditions and take action based on the results. The IF function is especially useful for making decisions based on complex criteria. By using an IF function with two conditions, users can quickly make decisions and automate processes that would otherwise be time-consuming and prone to errors. This makes Excel an indispensable tool for businesses and individuals who need to make decisions quickly and accurately.


You can use the following formulas to create an IF function with 2 conditions in Excel:

Method 1: Nested IF Function

=IF(C2<15, "Bad", IF(C2<20, "OK", "Good"))

Method 2: IF Function with AND Logic

=IF(AND(A2="Mavs", B2="Guard"), "Yes", "No")

Method 3: IF Function with OR Logic

=IF(OR(A2="Mavs", B2="Guard"), "Yes", "No")

The following examples show how to use each formula in practice with the following dataset in Excel:

Example 1: Nested IF Function

We can type the following formula into cell D2 to return a specific value based on the value for each player in the Points column:

=IF(C2<15, "Bad", IF(C2<20, "OK", "Good"))

We can then drag and fill this formula down to each remaining cell in column D:

Here’s what this formula did:

  • If the value in the Points column is less than 15, return Bad.
  • Else, if the value in the Points column is less than 20, return OK.
  • Else, return Good.

Example 2: IF Function with AND Logic

=IF(AND(A2="Mavs", B2="Guard"), "Yes", "No")

We can then drag and fill this formula down to each remaining cell in column D:

Excel IF function with two conditions using AND logic

Here’s what this formula did:

  • If the value in the Team column was “Mavs” and the value in the Position column was “Guard”, then return Yes.
  • Else, if at least one condition is not met then return No.

Example 3: IF Function with OR Logic

We can type the following formula into cell D2 to return “Yes” if one of two conditions are met for a specific player or “No” if neither of the conditions are met:

=IF(OR(A2="Mavs", B2="Guard"), "Yes", "No")

We can then drag and fill this formula down to each remaining cell in column D:

Excel IF function with two conditions using OR logic

Here’s what this formula did:

  • If the value in the Team column was “Mavs” or the value in the Position column was “Guard”, then return Yes.
  • Else, if neither of the conditions are met then return No.


In conclusion, this article has provided an overview of how to use IF functions with two conditions in Excel. Three different methods have been discussed, including the use of nested IF functions, IF functions with AND logic, and IF functions with OR logic. These methods can be used to return specific values based on two conditions found in any dataset. With this information, users can create powerful formulas in Excel to quickly analyze any data.

x