Documentation/Calc Functions/ISODD

    From The Document Foundation Wiki
    Other languages:


    Function name:

    ISODD

    Category:

    Information

    Summary:

    Determines whether a supplied number is even or odd. The sign of the number is ignored and if the value is not an integer, then any digits after the decimal separator are ignored.

    Syntax:

    ISODD(Value)

    Returns:

    Returns TRUE if the argument evaluates to an odd number and FALSE if the argument evaluates to an even number.

    Arguments:

    Value is an expression, or a reference to a cell containing an expression, that is to be tested for parity.

    • If Value is not an integer, then any digits after the decimal point are ignored.
    • The sign of Value is ignored.
    • If Value evaluates to a string, then ISODD reports a parameter list error (Err:504).

    Additional details:

    • ISODD propagates errors. For example, if cell D1 contains the formula =1/0 then the formula =ISODD(D1) returns the #DIV/0! error.
    • If reference to an empty cell is passed to ISODD, then ISODD reports a parameter list error (Err:504) whereas Microsoft Excel’s ISODD function returns FALSE.
    • If a text string or a reference to a cell containing a text string is passed to ISODD, then ISODD reports a parameter list error (Err:504) whereas Microsoft Excel’s ISODD function reports a #VALUE! error.
    • The ISODD_ADD function is similar to ISODD but ISODD_ADD returns the value 1 for an odd number and 0 for an even number. In addition, ISODD_ADD does not report the parameter list error (Err:504) – if passed an empty cell it returns 0 and if passed a text string then it returns the #VALUE! error.

    Examples:

    Formula Description Returns
    =ISODD(48) The value 48 is even and so the function returns the logical value FALSE. FALSE
    =ISODD(D1) where cell D1 contains the number 33. The value 33 is odd and so the function returns the logical value TRUE. TRUE
    =ISODD(0) The value 0 is even and so the function returns the logical value FALSE. FALSE
    =ISODD(−2.1) The negative sign and the digits after the decimal separator are ignored. The value 2 is even and so the function returns the logical value FALSE. FALSE
    =ISODD(3.999) The digits after the decimal separator are ignored. The value 3 is odd and so the function returns the logical value TRUE. TRUE

    Related LibreOffice functions:

    ISEVEN

    ISODD_ADD

    ODF standard:

    Section 6.13.23, part 2

    Related (or similar) Excel functions:

    ISODD