Using OR, AND & IF
We can combine both an OR and an AND function within an IF statement. By doing this, we can create some interesting conditional formulas to get even more out of our data.In Figure 1, we’ve added an additional column with a weekday to illustrate how you could use both an AND and OR function within an IF statement to really narrow down the type of value you get as a result:
AND, OR with IF ...
Our formula for the calculations in column D is:
=IF(OR(AND(A1>300,B1="Blue"),AND(A1<300,C1="Monday")),
"Correct","Wrong")
"Correct","Wrong")
So as you can see from this example, using both an AND and OR within an IF statement can really help you create some very pointed formulas to get exactly what you need out of your data from a conditional standpoint.
Curious as to what this would look like if it was just IF formulas?
=IF(A1>300,IF(B1="Blue","Correct","Wrong"),IF(C1="Monday",
"Correct","Wrong"))
"Correct","Wrong"))
No comments:
Post a Comment