if x else

Read(501) Label: if statement, if, else,

Description:

The introduction of if statement.

Syntax:

if  x

 

else 

 

Note:

if and else must be in the same column. Execute if code block if x is true and execute else code block if x is false. The else part can be omitted.

Parameters:

x

A boolean expression. If evaluated to be true, then execute if code block, otherwise, execute else code block.

Example:

 

A

B

 

1

=3

 

 

2

if A1>5

 

if code block

3

 

>A1=A1+10

4

else

 

else code block

5

 

>A1=A1+15

Related functions:

if x …{ else { if x}… }

if x … else

if x