Syntax. ROWS(array)
Definition. This function returns the number of rows of an array constant or a cell reference.
Arguments
array (required). An array constant or a reference to a cell range
Background. If you try to use a discontiguous range as the argument, you get the error message, “You’ve entered too many arguments for this function.” If you enclose these arguments in additional parentheses, you will get the #REF!
error. If the range is defined by intersections (created by including spaces between the cell references, as in the formula =ROWS(B2:D4 E2:E4)
and the intersection is empty, you will get the #NULL!
error.
Array constants are numbers or text enclosed in braces. Rows are separated by semicolons, and columns are separated commas. The simple expression {1;2;3;4} is interpreted as an array consisting of four rows, as shown by the result of
=ROWS({1;2;3;4})
The expression {11,12,13;21,22,23} indicates two rows, as shown by the result of
=ROWS({11,12,13;21,22,23})
Example. To access the last cell in the lower-right corner of a named range, use the formula
=INDEX(MyRange,ROWS(MyRange),COLUMNS(MyRange))
MyRange is the name of the range.
Sample Files
Use the Columns-Rows worksheet in the References.xls or References.xlsx sample file. The sample files are found in the Chapter10 folder. For more information about the sample files, see the section titled Using the Sample Files.
3.133.133.61