Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have a quick question on how to add a AND statement within an OR. Like the below: if(OR(x=1, y=2, b=3,( j=5 AND t=9 AND p=4)) |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
From your use of variables in the statement, it looks like you are asking
about combining OR with AND in an IF statement in VBA. That could be done like this: If (x = 1) Or (y = 2) Or (b = 3) Or (j = 5 And t = 9 And p = 4) Then If you mean how to combine OR with AND in a worksheet IF function, that could be done like this (I have replaced the variables with cell references): =IF(OR(H1=1,H2=2,H3=3,AND( J1=5,J2=9,J3=4)),TRUE,FALSE) Hope this helps, Hutch "prog" wrote: Hi, I have a quick question on how to add a AND statement within an OR. Like the below: if(OR(x=1, y=2, b=3,( j=5 AND t=9 AND p=4)) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
IF statement inside a SUMIF statement.... or alternative method | Excel Worksheet Functions | |||
Reconcile Bank statement & Credit card statement & accounting data | Excel Worksheet Functions | |||
Embedding an OR statement in an IF statement efficiently | Excel Discussion (Misc queries) | |||
Excel if and else statement | Excel Programming | |||
appending and IF statement to an existing IF statement | Excel Worksheet Functions |