Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Mar 2004
    Location
    North Carolina, USA
    Posts
    268
    Thanks
    0
    Thanked 0 Times in 0 Posts

    OR inside of AND IF (2003)

    I'd like to learn how to use OR inside of AND IF. My current formula is :
    IF(AND(AC20>=50000, AF20<=0.1), "Underbudget", "")

    I'd like to also evaluate AC20 and if it is <=0 and AF20<=.1 also display "Underbudget". I think I need an OR for this. Any idea on how to do this?

  2. #2
    5 Star Lounger
    Join Date
    Aug 2004
    Location
    Connecticut, USA
    Posts
    816
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: OR inside of AND IF (2003)

    Your formula would become:

    IF(AND(OR(AC20>=50000,AC20<=0), AF20<=0.1), "Underbudget", "")

  3. #3
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: OR inside of AND IF (2003)

    Harken back to your basic arithmetic lessons where there are rules of precedence:
    1. <LI>First evaluate everything within brackets; then
      <LI>Exponentiation; then
      <LI>Multiplication and Division; then
      <LI>Addition and Subtraction ; then
      <LI>In the case of operations of the same level of precedence, evaluation proceeds from left to right
    In the case of Logic
    1. <LI>First evaluate everything within brackets; then
      <LI>items immediately separated by "AND"; then
      <LI>items immediately separated by "OR"
    I think that the above protocol will satisfy all situations. If not, other Loungers should quickly advise us of my error.
    Regards
    Don

  4. #4
    Lounger
    Join Date
    Sep 2008
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: OR inside of AND IF (2003)

    For VBA Logicals, the order is:

    Not
    And
    Or
    Eqv
    Imp

    With the spreadsheet's pre-script notation, (AND(x,y)) the order of the precedence is not a factor.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •