AND is a logical operator that perform a Binary combination of the values on both sides of the operator. The AND Logical Operator allows multiple relational comparisons to be made into one statement, returning true (recording a value of 1) if ALL are true. If at least one comparison is false, the AND function records a 0.
SYNTAX:
(Binary Expression) AND (Binary Expression)
where :
Binary Expression is any expression that has a binary result (TRUE/FALSE or 1/0)
EXAMPLES:
V25 = C15>10 AND C21>10
V15 |
V21 |
V25 |
8 |
6 |
0 |
10 |
7 |
0 |
2 |
11 |
0 |
18 |
15 |
1 |
Used with an IF Statement:
IF(C15>10 AND C6>10,1,0) Returns 1 if the value for variable 15 is greater than 10 and the value ifor variable 21 is greater than 10. If either value is less than 10, then the result will be 0.
NOTES:
Typically used in the logical expression of an IF statement.