Successfully!

Error!

You are viewing 10.0 help doc. More details are displayed in the latest help doc

Logical Function

AND

Description

AND(value1, value2, ...)

Input

Values that participate in the logical operation. Type: logical values, cells and arrays.

Output

If all values are true, the output is true; otherwise, the output is false. Type: logical value.

Examples

If B2:E2 contains the following values:

B2

C2

D2

E2

=false

=true

5

10

  • AND(B2, C2) >> false

  • AND(C2, D2>1) >> true

  • AND(C2:E2) >> true

  • AND(C2:E2) >> true

IF

Description

IF(expression, true_result, false_result)  

Input

expression: a expression constructed by values, cells and operators.

 

true_result: the result to be returned when the expression is true. Type: number, string and logical value.

 

false_result: the result to be returned when the expression is false. Type: number, string and logical value.

Output

If all values are false, the output is false; otherwise, the output is true. Type: logical value.

 

Examples

If B2:E2 contains the following values:

 

B2

C2

D2

E2

=false

=true

5

10

 

  • IF(B2,"1","2") >> 2

  • IF(C2,"1","2") >> 1

  • IF(D2,"1","2") >> 2

  • IF(E2<10,"1","2") >> 2

 

OR

Description

OR(value1, value2, ...)  

Input

Values that participate in the logical operation. Type: logical values, cells and arrays.

Output

If all values are false, the output is false; otherwise, the output is true. Type: logical value.

 

Examples

If B2:E2 contains the following values:

 

B2

C2

D2

E2

=false

=true

5

10

 

  • OR(B2, C2) >> true

  • OR(B2, D2<1) >> false

  • OR(B2:E2) >> false

  • OR(B2:E2) >> false

REVERSE

Description

REVERSE(value)  

Input

The value that participates in the logical operation. Type: logical values or a cell that contains a logical value.

Output

If the input is true, the output is false, and vice versa. If the input is not a logical value, return #VALUE?. Type: logical value.

 

Examples

If B2:E2 contains the following values:

 

B2

C2

D2

E2

=false

=true

5

10

 

  • REVERSE(B2) >> true

  • REVERSE(C2) >> false

  • REVERSE(D2) >> #VALUE?

  • REVERSE(E2<10) >> true

SWITCH

Description

SWITCH(compared_value, reference_1, result_1, reference_2, result_2, ...)  

Input

compared_value: the value to be compared with reference_1, reference_2 and other reference values. Type: number, string, logical value or cell.

 

reference_1: the first reference value. Type: number, string or logical value.

 

result_1: the result value corresponding to reference_1. Type: number, string or logical value.

 

reference_2 [optional]: the second reference value. Type: number, string or logical value.

 

result_2 [optional]: the result value corresponding to reference_12. Type: number, string or logical value.

Output

Compare compared_value with the following reference values from left to right. If the two values are equal, output the result value corresponding to the reference value. If no reference value equals to compared_value, output null. Type: number, string or logocal value.

 

Examples

If B2:E2 contains the following values:

 

B2

C2

D2

E2

=false

=true

5

10

 

  • SWITCH(B2, true, "1", false, "2", "5","3","10","4") >> 2

  • SWITCH(C2, true, "1", false, "2", "5","3","10","4") >> 1

  • SWITCH(D2, true, "1", false, "2", "5","3","10","4") >> 3

  • SWITCH(E2, true, "1", false, "2", "5","3","10","4") >> 4

 

String and number are comparable:

  • SWITCH(5, true, "1", false, "2", "5","3","10","4") >> 3

  • SWITCH(10, true, "1", false, "2", "5","3","10","4") >> 4

 

Return null when no reference value equals to the compared_value

  • SWITCH(20, true, "1", false, "2", "5","3","10","4") >> null

logical.cpt


Attachment List


Theme: Report Application
Already the First
Already the Last
  • Helpful
  • Not helpful
  • Only read

Doc Feedback