Missing Values and Logical Operators (DO IF command)

When two or more relations are joined by logical operators AND and OR, the program always returns missing if all of the relations in the expression are missing. However, if any one of the relations can be determined, the program tries to return true or false according to the logical outcomes shown in the following table. The asterisk indicates situations where the program can evaluate the outcome with incomplete information.

Table 1. Logical outcomes
Expression Outcome Expression Outcome
true AND true = true true OR true = true
true AND false = false true OR false = true
false AND false = false false OR false = false
true AND missing = missing true OR missing = true*
missing AND missing = missing missing OR missing = missing
false AND missing = false* false OR missing = missing