<!DOCTYPE html> <html> <head> <title>IF Function</title> <meta charset="utf-8" /> <meta name="description" content="" /> <link type="text/css" rel="stylesheet" href="../editor.css" /> </head> <body> <div class="mainpart"> <h1>IF Function</h1> <p>The <b>IF</b> function is one of the logical functions. Is used to check the logical expression and return one value if it is TRUE, or another if it is FALSE.</p> <p>The <b>IF</b> function syntax is:</p> <p style="text-indent: 150px;"><b><em>IF(logical_test, value_if_true, value_if_false)</em></b></p> <p>where <b><em>logical_test</em></b>, <b><em>value_if_true</em></b>, <b><em>value_if_false</em></b> are values entered manually or included into the cell you make reference to.</p> <p>To apply the <b>IF</b> function,</p> <ol> <li>select the cell where you wish to display the result,</li> <li>click the <b>Insert Function</b> <img alt="Insert Function icon" src="../images/insertfunction.png" /> icon situated at the top toolbar, <br />or right-click within a selected cell and select the <b>Insert Function</b> option from the menu, <br />or click the <img alt="Function icon" src="../images/function.png" /> icon situated at the formula bar, </li> <li>select the <b>Logical</b> function group from the list,</li> <li>click the <b>IF</b> function,</li> <li>enter the required arguments separating them by commas,</li> <li>press the <b>Enter</b> button.</li> </ol> <p>The result will be displayed in the selected cell.</p> <p><em>For example:</em></p> <p>There are three arguments: <em>logical_test</em> = <b>A1<100</b>, <em>value_if_true</em> = <b>0</b>, <em>value_if_false</em> = <b>1</b>, where <b>A1</b> is <b>12</b>. This logical expression is <b>TRUE</b>. So the function returns <b>0</b>.</p> <p style="text-indent: 150px;"><img alt="IF Function: TRUE" src="../images/iftrue.png" /></p> <p>If we change the <b>A1</b> value from <b>12</b> to <b>112</b>, the function returns <b>1</b>:</p> <p style="text-indent: 150px;"><img alt="IF Function: FALSE" src="../images/iffalse.png" /></p> </div> </body> </html>