This article requires some knowledge on:

- Logical comparators (coming soon)

- Variables (coming soon)

The **IF function** checks whether a condition is met, and returns one value if TRUE and another value if FALSE.**Syntax **

The syntax of IF Function is as follows:

IF( LOGIC_TEST, VALUE_IF_TRUE, VALUE_IF_FALSE )

‘LOGIC_TEST’ refers to the expression that is to be evaluated.

‘VALUE_IF_TRUE’ is the output of IF Statement if the logic test is TRUE.

‘VALUE_IF_FALSE’ is the output of IF Statement if the logic is FALSE.

**Examples**

IF ( x > 1, "x is grater than 1", "x is smaller than 1" )

In this case, if x = 10, then the function returns "x is greater than 0". If x = 0, then the function will return "x is smaller than 1"

IF( 1==1, "TRUE", "FALSE") will output "TRUE"

IF( 1>=1, "TRUE", "FALSE") will output "TRUE"

IF( 1<=1, "TRUE", "FALSE") will output "TRUE"

IF( 1>1, "TRUE", "FALSE") will output "FALSE"

IF( 1<1, "TRUE", "FALSE") will output "FALSE"

IF( 1!=1, "TRUE", "FALSE") will output "FALSE"

## Comments

0 comments

Please sign in to leave a comment.