Excel IF Function with 3 Conditions (5 Logical Tests)

When you are performing complicated and powerful data analysis, you need to justify various conditions at a single point in time. In Microsoft Excel, the IF function acts as a powerful tool to work on conditions. In this tutorial, we will be working on the nested IF function in Excel. We will analyze the IF function with 3 conditions in Excel based on 5 logical tests.


To describe the process, here is a dataset of a company’s Sales Report. It shows the information of Product Code and Monthly Sales in cell range B4:C10.

5 Logical Tests on Excel IF Function with 3 Conditions

We need to determine the Sales Status according to these 3 conditions shown in the image below:


Now, let us apply the following logical tests to identify the status of the 6 products in the dataset.

1. Applying Nested IF Function with 3 Conditions in Excel

In Excel, we can nest multiple IF functions at the same time to perform complicated calculations.

In this article, we will apply the nested IF function for 3 conditions. Let’s follow the process.

  • First, insert this formula in cell D5.
=IF(C5>=2500,"Excellent",IF(C5>=2000,"Good",IF(C5>=1000,"Average")))

Nested IF Function with 3 Conditions

  • Next, hit Enter.
  • After that, you will see the first status based on the conditions applied.

Here, we used the IF function to apply a logical comparison between the conditions for the selected cell C5.

  • Following, use the Autofill tool and you will get all the status for each sales amount.

Excel IF Function with 3 Conditions


2. Combining IF Function & Excel AND Logic for 3 Conditions

In this section, we will apply the IF function incorporating the AND function for the logical test. Follow the steps below.

  • First, insert this formula in cell D5.
=IF(AND(C5>=2500),"Excellent",IF(AND(C5>=2000),"Good",IF(AND(C5>=1000),"Average","")))

IF Function with AND Logic for 3 Conditions in Excel

  • Next, press Enter and you will see the first output.

Here, we combined the IF and AND functions to compare each condition with their text individually and return the value if the conditions do not meet the cell value in C5. In the end, we inserted the Empty String (“”) to omit empty cells if any.

  • Lastly, apply this formula for cell range D6:D10 and see the final result.


3. Joining Excel IF Function with OR Logic Based on 3 Conditions

The combination of IF and OR functions is also a very powerful tool to run the logic test with 3 conditions. Let’s see how it works.

  • In the beginning, select cell D5.
  • Here, insert this formula.
=IF(OR(C5>=2500),"Excellent",IF(OR(C5>=2000),"Good",IF(OR(C5>=1000),"Average","")))

Excel IF Function with OR Logic Based on 3 Conditions

  • After that, hit Enter.
  • Lastly, use the AutoFill tool in cell range D6:D10.
  • Finally, you will see the output as shown below:

Here, the IF and OR function benefits comparison within 3 conditions. Therefore, it determines the conditions Excellent, Good and Average according to their values.


4. Applying SUM with Excel IF Statement for 3 Conditions

If your dataset does not work on any of the logical tests above, you can go for the SUM function incorporated in the IF statement. It will successfully work for the 3 conditions.

  • First, apply this formula in cell D5.
=IF(SUM(C5>=2500),"Excellent",IF(SUM(C5>=2000),"Good","Average"))

Excel IF Statement with SUM Function for 3 Conditions

  • After this, press Enter to see the first output.

Here, the combination of the IF function compares each condition against the value in cell C5. Following this, the SUM function calculates the value based on the condition to determine whether it is true or false.

  • Lastly, apply the AutoFill tool and you will get all the statuses with 3 conditions.


5. Combining Excel IF & AVERAGE Functions with 3 Conditions

The AVERAGE function is also helpful if you have a different set of data strings. It combines with the IF function for comparing between conditions. Let’s see the process below.

  • In the beginning, select cell D5.
  • Then, insert this formula into the cell.
=IF(AVERAGE(C5>=2500),"Excellent",IF(AVERAGE(C5>=2000),"Good","Average"))

Combine IF & AVERAGE Functions with 3 Conditions in Excel

  • After that, press Enter.
  • Lastly, apply this formula for cell range D6:D10.
  • Finally, you will see the output as shown below.

Here, we used the IF function for comparing the 3 conditions. Then, applied the AVERAGE function to return the average value (if any) for the selected cell.


Excel IF Function with 2 Conditions

Here is an additional tip for you, if you are working with 2 conditions. Let’s see how the IF function works in this case.

  • In the beginning, let us take two conditions: Profit and Loss based on the values >=2500 and >=1000 respectively.

Excel IF Function with 2 Conditions

  • Then, insert this formula in cell D5.
=IF(AND(C5>=2500,OR(C5>=1000)),"Profit","Loss")

  • After this, press Enter and you will see the first status for the value in cell C5.

Here, the IF, AND & OR functions are combined to determine the conditions of Profit and Loss for cell C5 based on the conditional values.

  • Lastly, use the FlashFill tool and get the final output based on 2 conditions.


Things to Remember

  • It is mandatory to follow the order of the conditions in the formula that you initially set up. Otherwise, it will show the wrong value.
  • Make sure to balance every Parenthesis according to the numbers and order inside the formula to get a proper result.
  • If the conditions are placed in Text format, they must be enclosed within double quotes.

Download Practice Workbook

Download this practice file and try the methods by yourself.


Conclusion

Concluding this article with the hope that it was a helpful one on Excel IF function with 3 conditions based on 5 logical tests. I also tried to cover the process in 2 conditions. Let us know your insightful suggestions in the comment box.


Related Articles


<< Go Back to Multiple IF Condition in Excel | Excel IF Function | Excel Functions | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Siam Hasan Khan
Siam Hasan Khan

Hello! Welcome to my Profile. Here I will be posting articles related to Microsoft Excel. I have completed my BSc in Electrical and Electronic Engineering from American International University-Bangladesh. I am a diligent, goal-oriented engineer with an immense thirst for knowledge and an attitude to grow continuously. Continuous improvement and life-long learning are my mottoes.

8 Comments
  1. With your guidance, every thing seems to be so easy and simple.

  2. Thanks for teaching formula with easy learning example.
    This is helping people like me in profession to making reports and getting work faster.

  3. hi i want to create a formula that meet below condition, could you help, thanks:
    A equal B equal and it have to be more than 0 (which is not blank) then Matched if not the unmatched
    if Both A and B is blank then show blank ” “

    • Thanks, LOUIS for reaching out to us. Please drop your excel file and queries at [email protected]
      This is Aung, one of the writers of ExcelDemy. I’d like to help to solve your problem, but I didn’t exactly understand your criteria. I hope you elaborate a bit further.
      Thanks.

  4. Thank you for your nice training. it will help me a lot

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo