Documentation/Calc Functions/MODE

    From The Document Foundation Wiki

    Function name:

    MODE

    Category:

    Statistical Analysis

    Summary:

    Finds the mode of an unsorted set of numbers containing at least one duplicate value. The mode is the most frequently occurring number in the set.

    If there are multiple mode values with the same frequency of occurrence, MODE returns the smallest.

    Syntax:

    MODE(Number 1 [; Number 2 [; … [; Number 255]]])

    Returns:

    Returns a real number, which is the mode of the supplied set of numbers.

    Arguments:

    Number 1, Number 2, … , Number 255 give the set of real numbers from which the mode is to be calculated. Each argument may be a value or an expression, a reference to a single cell, a reference to a cell range, the name of a named or database range, or an inline array.

    Note that although MODE can accept up to 255 arguments, each argument could specify a range of cells. This means that many more than 255 real numbers could be processed.

    The following conditions (including errors) may be encountered:

    • If any argument is a string in quotation marks, then MODE reports a parameter list error (Err:504).
    • Text in cells and empty cells are ignored.
    • If the list of supplied numbers includes no duplicate values, then MODE reports a #VALUE! error.
    • If there are multiple duplicate values that qualify as the most frequently occurring, then MODE returns the smallest of those values.

    Additional details:

    • MODE meets the requirements stated in Section 6.18.50 of ODF 1.2. However, in the case when there are multiple duplicate values qualifying as the most frequently occurring value, the exact value returned by Microsoft Excel is dependent on the order in which the numbers are passed to MODE. For example, the Excel formula =MODE(1,2,1,2) returns 1 while the Excel formula =MODE(2,1,2,1) returns 2. In Calc, both formulas return 1. Users should be aware of this difference if interoperability is important and consider using the MODE.SNGL function instead.
    • For more information on the mode value, visit Wikipedia's Mode (statistics) page.

    Examples:

    Formula Description Returns
    =MODE(A1:A10) where cells A1:A10 contain the values 1, 2, 3, 2, 4, 1, 3, 5, 6, and 3 respectively. Here the function returns the most common value within the supplied range. 3
    =MODE(3; 2; 1; 2; 4; 1; 3) Here there are three values that occur twice and MODE returns the smallest of these three. 1
    =MODE({-0.6; 0.5; 0.1; -0.2; -0.2; 0.3; 0.5; -0.2; 0.7}) Here nine values are passed as an inline array. -0.2

    Related LibreOffice functions:

    AVERAGE

    MEDIAN

    MODE.MULT

    MODE.SNGL

    ODF standard:

    Section 6.18.50, part 2

    Related (or similar) Excel functions:

    MODE