Use the logical function if (yielding one of two specific values) with comparison operator: =, >, <.
To use the logical function ‘IF’, we need to follow the same steps as before to reach the ‘Function Wizard’. In the ‘Function Wizard’, select ‘Logical’ in the ‘Category’ and from ‘Function’, select ‘IF’. Click on ‘Next’ and the following dialog is displayed.
The ‘IF’ function takes three arguments, these are ‘Test’, ‘Then_value’ and ‘Otherwise_value’. ‘Test’ is the condition which needs to be tested for being either true or false. A condition could be anything and can be defined with the help of comparison operators. Here we’ll put a simple condition ‘K8>1000’, this will check whether the number present in the cell K8 is greater than 1000 or not. ‘Then_value’ defines the value which will get printed in the target cell if the condition is satisfied and ‘Otherwise_value’ defines the value which will get displayed if the condition is not satisfied. Here we’ll put the ‘Then_value’ as “Is greater than 100” and ‘Otherwise_value’ as “Is less than 1000”. Anything which is put inside “” in Calc is considered to be text by the tool, this should be kept in mind while making inputs to the tool. After making all the inputs, click on ‘OK’.
Since the value in cell K8 here is 1032, which is greater than 1000, so “Is greater than 1000” gets displayed in the selected cell. This is how ‘IF’ function works.