A fruit seller is selling apples. You would only buy Apples if they are Red and Juicy. If an apple is not Red or Juicy, you will not buy it.
So here you have two conditions. How would you do that in Excel without using nested IFs. There is a easy combination of IF and AND function to do so. Let’s see how…
Lets consider the example we discussed in the beginning.
We have this table of apple’s color and type.
If color is “Red” and type is “Juicy” then write OK in column D. Else type Not OK.
Write this IF-AND formula in D2 column and drag it down.
And you can see now that only apples that are Red and Juicy are marked OK.
IF function: You know how IF function in Excel works. It takes a boolean expression as first argument and returns one expression IF TRUE and another if FALSE. Learn more about The Excel IF Function.
AND Function Function : Checks multiple conditions. Returns TRUE only if all conditions are TRUE else returns FALSE.
In the end, AND function provides IF function TRUE or FALSE argument and based on that IF prints the result.
Another way to do this is to use nested IFs for Multiple Conditions.
Nested IF is good when we want different results but not when only one result. It will work but for multiple conditions it will make your excel formula to long.
So here we learned about how to use IF with AND to check multiple conditions and show the result only if all of them are true. But what if you want to show the result if at least one condition is true? We will use IF with OR function in excel to do so.
The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.