IF returns one value if a condition you specify is true and another value if that same condition evaluates to false.
SYNTAX:
IF(ConditionalStatement, TrueResult, FalseResult)
where :
ConditionalStatement is a logical statement comparing values such as variables, numbers and equations; usually including a comparison operator (<,>,=,<=,>=, etc.) or comparison function (i.e., TextEq can be used to compare text values).
TrueResult is the Expression to return if the conditional statement is evaluated as TRUE
FalseResult is the Expression returned if the conditional statement is evaluated as FALSE
NOTES:
TrueResult and FalseResult may be variable references, numeric values, numeric expressions (calculations) or other IF Statements (known as nested IF statements).
True is defined as any non-zero value and False is zero.
EXAMPLES:
V134 = IF(V70 > 8, V71, V70)
The if statement above reads: IF variable 70 is greater than 8, return the contents of variable 71, otherwise, return the contents of variable 70:
IF(C15>10 AND C6>10,1,0) Returns 1 if the value for variable 15 is greater than 10 and the value for variable 6 is greater than 10. If either value is less than or equal to 10, then the result will be 0. See also AND operator.
IF(C15>10 OR C6>10,5,10) Returns 5 if the value for variable 15 is greater than 10 or the value for variable 6 is greater than 10. See also OR operator.