Logical Function

  • Last update:  2020-12-17
  • 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 Features
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy