View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default Can I combine IF/AND/OR statements?

You have a logic problem in the AND functions:

Cust!D24Cust!C24
Cust!D26Cust!C26

Those will *never* be TRUE.

Also, you have a problem with the IF functions. If the AND function is TRUE
(which it will never be) you want to return the value of Cust!C24 and if the
AND function is FALSE you still want to return the value of Cust!C24.

Try explaining in words what you want to do.

--
Biff
Microsoft Excel MVP


"CJOHNSO92" wrote in message
...
Can I combine 2 IF/AND/OR statements? Below are the two formulas -
individually, they each calculate properly.

IF(AND(OR(Cust!B5="X",Cust!B5="Y"),Cust!D24Cust!C 24),Cust!C24,Cust!D24)

IF(AND(OR(Cust!B5="X",Cust!B5="Y"),Cust!D26Cust!C 26),Cust!C26,Cust!D26)

When combined, I get an error:
IF((AND(OR(Cust!B5="X",Cust!B5="Y"),Cust!D24Cust! C24),Cust!C24,Cust!D24),IF(AND(OR(Cust!B5="X",Cust !B5="Y"),Cust!D26Cust!C26),Cust!C26,Cust!D26))

Any assistance appreciated! Thanks-