ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   If function with some "And" plus an "Or" criteria (https://www.excelbanter.com/excel-discussion-misc-queries/209451-if-function-some-plus-criteria.html)

Andy

If function with some "And" plus an "Or" criteria
 
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.

David Biddulph[_2_]

If function with some "And" plus an "Or" criteria
 
=IF(AND(criterion1,OR(criterion2,criterion3)),valu e_if_true,value_if_false)
or
=IF(OR(criterion1,AND(criterion2,criterion3)),valu e_if_true,value_if_false)
or nest the functions to suit your requirements.
--
David Biddulph

"Andy" wrote in message
...
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.




joel

If function with some "And" plus an "Or" criteria
 
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.


"Andy" wrote:

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.


John C[_2_]

If function with some "And" plus an "Or" criteria
 
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)
--
** John C **


"Andy" wrote:

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.


Dave Peterson

If function with some "And" plus an "Or" criteria
 
=if(and(a1=5,b1=3,or(c1=5,c1=17)),"a1=5 AND b1=3 And c1=(5or17)","one not true")

Andy wrote:

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.


--

Dave Peterson


All times are GMT +1. The time now is 01:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com