Documentation/Calc Functions/ROW

    From The Document Foundation Wiki
    Other languages:


    Function name:

    ROW

    Category:

    Spreadsheet

    Summary:

    Determines the row number(s) of a given reference to a single cell or to a range of cells.

    Syntax:

    ROW([Reference])

    Returns:

    Returns one or more positive integers in the range 1 to 1048576 (inclusive), which is/are the row number(s) of the cell(s) specified in the argument.

    • If the Reference argument is omitted, the row number of the cell in which the formula is entered is returned.
    • If the Reference argument refers to a single cell, the row number of that cell is returned.
    • If the Reference argument refers to a rectangular cell range and the formula was not entered as an array formula (completed using Enter), the number of the upper row in the range is returned.
    • If the Reference argument refers to a single rectangular cell range and the formula was entered as an array formula, all row numbers of the area are returned in a single-column array.

    Arguments:

    Reference is a specific cell reference (for example, "$Sheet1.A1"), a specific cell range (for example, "$Sheet1.$C$28:$H$29"), or the name of a named or database range.

    • If Reference is omitted, the row number of the cell in which the formula is entered is returned.
    • If Reference is not a valid reference to a single cell or a single rectangular cell range, then ROW reports a parameter list error (Err:504). ROW does not process references that comprise multiple cell ranges.

    Additional details:

    • The detailed behavior of the ROW function depends on the nature of the argument and whether the function call has been entered as an array formula.
    • To create an array formula, type the formula in the Input line in the upper part of the Calc window and on completion press Control+Shift+Enter (Command+Shift+Enter on macOS) rather than the more usual Enter. Alternatively, use the Function Wizard to construct the call to the ROW function and tick the Array toggle button before pressing OK. If you click on a cell that contains an array formula and view the formula in the Input line, then the content of that cell will be surrounded by curly brackets, for example {=ROW(A1:Z26)}. It is not possible to create an array formula by simply typing the curly brackets around a non-array formula.

    Examples:

    Formula Description Returns
    =ROW() where this formula is entered in cell Z14. Here the function determines the row number of cell Z14 and returns 14. 14
    =ROW(D9) Here the function returns 9, the row number of cell D9. 9
    =ROW($Sheet4.C11:E17) Here the function returns 11, the row number of cell C11 (the top-left cell in the specified area). 11
    {=ROW(myArea)} where the formula is entered as an array formula and the named range myArea covers the cell range D11:F16. The function returns a six element, single-column array containing the numbers of rows 11 to 16. (11, 12, 13, 14, 15, 16)
    {=ROW(B2:Z2)} where the formula is entered as an array formula. Here the function returns the number of row 2 – although entered as an array formula, the supplied reference only contains cells in row 2. Since the non-array formula =ROW(B2:Z2) also returns 2, it does not make a difference whether or not the formula is used as an array formula. 2

    Related LibreOffice functions:

    COLUMN

    ROWS

    SHEET

    ODF standard:

    Section 6.13.29, part 2

    Related (or similar) Excel functions:

    ROW