adding logical operator

Added a logical operator into the formula.