View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Billy Liddel Billy Liddel is offline
external usenet poster
 
Posts: 527
Default Mandatory and optional formula

Try:

=IF(AND(OR(COUNTIF(A1:A2,"Pre")0,COUNTIF(A1:A2,"N ")0),OR(COUNTIF(A3:A4,"Pre")=2,COUNTIF(A3:A4,"N") =2)),"PRE","N")

HTH
Peter

"Patrick" wrote:

I am trying to figure out how to write a formula where certain things are
mandatory and others are optional. Say I have cells A1, A2, A3, A4 and A5.
A5 is where I want the result that will either be "N" or "PRE".

I want a formula that says If EITHER A1 and A2 equal "N' or "PRE" and if
BOTH A3 and A4 equal "N" or "PRE", then A5 will equal "PRE", otherwise A5
will equal "N".

I assume there is a way to nest an if/and with an "if/or" but can't seem to
get it to work!