OpenOffice3.org Calc 3. Logical Functions

IF(Test; Then_value; Otherwhise_value) Function

This function returns a value of a certain condition is met. On the other hand, if the condition is not met, the function returns other value. The data type returned by the function depends on the arguments assigned. The argument “Test” contains an expression that returns a logical value, may also contain a reference to a cell that has the formula to be evaluated. The argument “Then_value” contains the value returned by the function if it complies with the condition. The argument “Otherwhise_value” contains the value to be returned if not satisfied with the condition defined in the first argument. For example:

=IF(A1>6;"Is greater";"Not is greater") ” The function returns a text data type. If the contents of cell A1 is greater than 6, then the function returns the text “is greater”, otherwise, it returns the text “Not is greater”.

=IF(B2= "Red";"Red color";"Other color") If cell B2 contains the text “Red” the function returns the text “Red”. Otherwise, it returns “Other color”.

 

Back to the list of logical functions