Documentation/Calc Functions/MAX

    From The Document Foundation Wiki

    Function name:

    MAX

    Category:

    Statistical Analysis

    Summary:

    Determines the maximum value contained in the supplied set of numbers, ignoring text strings and empty cells.

    Syntax:

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

    Returns:

    Returns a real number, which is the maximum value in the supplied set of numbers.

    Arguments:

    Number 1, Number 2, … , Number 255 give the set of real numbers from which the maximum is to be identified. 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 MAX can accept up to 255 arguments, each argument could specify a range of cells. This means that the number of real numbers processed could be many more than 255.

    The following conditions (including errors) may be encountered:

    • If any argument is a string in quotation marks, then MAX reports a #VALUE! error.
    • Text in cells and empty cells are ignored.
    • If there are no supplied numbers, then MAX returns 0.
    • If only one value is supplied, then MAX returns that value.

    Additional details:

    • MAX ignores any text in cells. If you suspect wrong results, look for text within the supplied data range(s). To highlight text content within a data range, use Calc's View ▸ Value Highlighting feature.

    Examples:

    Formula Description Returns
    =MAX(A1:A3; 9; 5; 4) where cells A1:A3 contain the values 1, 2, and 3 respectively. Here the function returns the largest of the six supplied values. 9
    =MAX(1.5; -2; 0; -4.2) Here the function returns the largest of the four supplied values. 1.5
    =MAX({5, 2, 8, 10, 2}) Here the function returns the largest of the five values supplied as an inline array. 10
    =MAX(A1; A2; A3; A4) where cells A1:A2 contain the values -4 and -2 respectively, while cell A3 is blank and cell A4 contains the text "LibreOffice" (entered without typing the quotation marks). Here the function returns the largest of the two values supplied and ignores the empty cell and the cell containing a string. -2

    Related LibreOffice functions:

    MAXA

    MAXIFS

    MIN

    MINA

    MINIFS

    ODF standard:

    Section 6.18.45, part 2

    Related (or similar) Excel functions:

    MAX