Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Combine AND, OR in an IF Statement

Is it possible to perform the following calculation? (I hope it's not too
confusing).

IF(AND(A2="Compliant",A3="Compliant")OR(A2="Compli ant",A3="Not
Counted"),"Compliant","")

I have 9 seperate conditions but only three possible outcomes and you can
only nest up to 7. The conditions are the following:

A2, A3 (outcome on the three are all Compliant)
Compliant, Compliant
Compliant, Not Counted
Not Counted, Compliant

A2, A3 (outcome on all five are all Non Compliant)
Non Compliant, Non Compliant
Non Compliant, Compliant
Compliant, Non Compliant
Non Compliant, Not Counted
Not Counted, Non Compliant

A2, A3 (this is the only that equals Not Counted)
Not Counted, Not Counted

Thanks for the help.
Frank
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Combine AND, OR in an IF Statement

Try this:

=IF(AND(A2="Not Counted",A3="Not Counted"),"Not Counted",IF(OR(A2="Non
Compliant",A3="Non Compliant"),"Non Compliant","Compliant"))

Hope this helps.

Pete

On Feb 8, 4:55*pm, FrankTimJr
wrote:
Is it possible to perform the following calculation? *(I hope it's not too
confusing).

IF(AND(A2="Compliant",A3="Compliant")OR(A2="Compli ant",A3="Not
Counted"),"Compliant","")

I have 9 seperate conditions but only three possible outcomes and you can
only nest up to 7. *The conditions are the following:

A2, A3 (outcome on the three are all Compliant)
Compliant, Compliant
Compliant, Not Counted
Not Counted, Compliant

A2, A3 (outcome on all five are all Non Compliant)
Non Compliant, Non Compliant
Non Compliant, Compliant
Compliant, Non Compliant
Non Compliant, Not Counted
Not Counted, Non Compliant

A2, A3 (this is the only that equals Not Counted)
Not Counted, Not Counted

Thanks for the help.
Frank


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,389
Default Combine AND, OR in an IF Statement

Try this:
=if(and(a2="not counted",a3="not counted"),"Not
Counted",if(and(or(a2="compliant",a2="not
counted"),or(a3="compliant",a3="not counted")),"Compliant","Non Compliant"))

Regards,
Fred

"FrankTimJr" wrote in message
...
Is it possible to perform the following calculation? (I hope it's not too
confusing).

IF(AND(A2="Compliant",A3="Compliant")OR(A2="Compli ant",A3="Not
Counted"),"Compliant","")

I have 9 seperate conditions but only three possible outcomes and you can
only nest up to 7. The conditions are the following:

A2, A3 (outcome on the three are all Compliant)
Compliant, Compliant
Compliant, Not Counted
Not Counted, Compliant

A2, A3 (outcome on all five are all Non Compliant)
Non Compliant, Non Compliant
Non Compliant, Compliant
Compliant, Non Compliant
Non Compliant, Not Counted
Not Counted, Non Compliant

A2, A3 (this is the only that equals Not Counted)
Not Counted, Not Counted

Thanks for the help.
Frank


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Combine AND, OR in an IF Statement

I got it.

I had to reverse it to OR AND rather than AND OR.

=IF(AND(AN2="Not Counted",AO2="Not Counted"),"Not
Counted",IF(OR(AND(AN2="Compliant",AO2="Compliant" ),AND(AN2="Compliant",AO2="Not
Counted"),AND(AN2="Not
Counted",AO2="Compliant")),"Compliant",IF(OR(AND(A N2="Non Compliant",AO2="Non
Compliant"),AND(AN2="Non
Compliant",AO2="Compliant"),AND(AN2="Compliant",AO 2="Non
Compliant"),AND(AN2="Non Compliant",AO2="Not Counted"),AND(AN2="Not
Counted",AO2="Non Compliant")),"Non Compliant","Next")))

In theory, the final "FALSE" condition should never happen and in my data it
doesn't.

Thank you!
Frank

"Fred Smith" wrote:

Try this:
=if(and(a2="not counted",a3="not counted"),"Not
Counted",if(and(or(a2="compliant",a2="not
counted"),or(a3="compliant",a3="not counted")),"Compliant","Non Compliant"))

Regards,
Fred

"FrankTimJr" wrote in message
...
Is it possible to perform the following calculation? (I hope it's not too
confusing).

IF(AND(A2="Compliant",A3="Compliant")OR(A2="Compli ant",A3="Not
Counted"),"Compliant","")

I have 9 seperate conditions but only three possible outcomes and you can
only nest up to 7. The conditions are the following:

A2, A3 (outcome on the three are all Compliant)
Compliant, Compliant
Compliant, Not Counted
Not Counted, Compliant

A2, A3 (outcome on all five are all Non Compliant)
Non Compliant, Non Compliant
Non Compliant, Compliant
Compliant, Non Compliant
Non Compliant, Not Counted
Not Counted, Non Compliant

A2, A3 (this is the only that equals Not Counted)
Not Counted, Not Counted

Thanks for the help.
Frank


.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,389
Default Combine AND, OR in an IF Statement

I'm glad it works for you. You might want to change "Next" to "Error" if is
should never happen. That's more likely to spur someone to action to look
for an error in the data.

Regards,
Fred

"FrankTimJr" wrote in message
...
I got it.

I had to reverse it to OR AND rather than AND OR.

=IF(AND(AN2="Not Counted",AO2="Not Counted"),"Not
Counted",IF(OR(AND(AN2="Compliant",AO2="Compliant" ),AND(AN2="Compliant",AO2="Not
Counted"),AND(AN2="Not
Counted",AO2="Compliant")),"Compliant",IF(OR(AND(A N2="Non
Compliant",AO2="Non
Compliant"),AND(AN2="Non
Compliant",AO2="Compliant"),AND(AN2="Compliant",AO 2="Non
Compliant"),AND(AN2="Non Compliant",AO2="Not Counted"),AND(AN2="Not
Counted",AO2="Non Compliant")),"Non Compliant","Next")))

In theory, the final "FALSE" condition should never happen and in my data
it
doesn't.

Thank you!
Frank

"Fred Smith" wrote:

Try this:
=if(and(a2="not counted",a3="not counted"),"Not
Counted",if(and(or(a2="compliant",a2="not
counted"),or(a3="compliant",a3="not counted")),"Compliant","Non
Compliant"))

Regards,
Fred

"FrankTimJr" wrote in message
...
Is it possible to perform the following calculation? (I hope it's not
too
confusing).

IF(AND(A2="Compliant",A3="Compliant")OR(A2="Compli ant",A3="Not
Counted"),"Compliant","")

I have 9 seperate conditions but only three possible outcomes and you
can
only nest up to 7. The conditions are the following:

A2, A3 (outcome on the three are all Compliant)
Compliant, Compliant
Compliant, Not Counted
Not Counted, Compliant

A2, A3 (outcome on all five are all Non Compliant)
Non Compliant, Non Compliant
Non Compliant, Compliant
Compliant, Non Compliant
Non Compliant, Not Counted
Not Counted, Non Compliant

A2, A3 (this is the only that equals Not Counted)
Not Counted, Not Counted

Thanks for the help.
Frank


.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
combine if(and statement [email protected] Excel Worksheet Functions 4 March 10th 09 03:07 PM
Combine cells with the same reference and combine quantities brandon Excel Discussion (Misc queries) 2 September 17th 08 05:44 PM
How to combine IF statement and Vlookup function? mcmilja Excel Discussion (Misc queries) 2 June 6th 08 06:07 PM
combine IF, AND and OR operstors in a statement Vince Excel Worksheet Functions 10 December 19th 07 10:39 PM
HLookup, IF statement, multiple sort, somehow combine all of these Gita at CASTLE Excel Worksheet Functions 0 May 2nd 06 07:43 PM


All times are GMT +1. The time now is 07:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"