If function with some "And" plus an "Or" criteria

A

Andy

Is this possible to do? I know how to do an If with AND:

IF(AND(criteria1,criteria2),True,False)

and I can do an OR:

IF(OR(criteria1,criteria2),True,False)

but can I do both? Thanks for any help.
 
D

David Biddulph

=IF(AND(criterion1,OR(criterion2,criterion3)),value_if_true,value_if_false)
or
=IF(OR(criterion1,AND(criterion2,criterion3)),value_if_true,value_if_false)
or nest the functions to suit your requirements.
 
J

Joel

You can have multiple ANDs and ORs in a logic equation. But doing an OR will
include theh AND condition

AND Table
B
False True

A False False False
True False True


OR Table

B
False True

A False False True
True True True



The condition A = True and B = True is True in both tables above.
 
J

John C

Say you have a situation where you have multiple criteria, and you want a
true to return with the All of the following criteria:
1: Criteria1 OR Criteria 2
2: Criteria3
4: Criteria4 & Criteria5 or Criteria6
=IF(AND(OR(crit1,crit2),crit3,OR(AND(crit4,crit5),crit6)),TRUE,FALSE)
 
D

Dave Peterson

=if(and(a1=5,b1=3,or(c1=5,c1=17)),"a1=5 AND b1=3 And c1=(5or17)","one not true")
 
Top