ROWS

Return the number of rows in a range or array.

Syntax

ROWS(array)
Argument Required Description
array Required A range or array.

Examples

Every example below was executed against VisiGrid engine 0.54.0 — not transcribed from another vendor's documentation. Reproduce any of them with vgrid calc.

Formula Result Notes
=ROWS(A2:D4) 3
=ROWS(A2:A100) 99 It counts positions, whether or not they hold anything.
=ROWS(A2:D4)*COLUMNS(A2:D4) 12 The number of cells in a rectangle.

Counting positions, not values

ROWS measures the range, not what is in it: ROWS(A2:A100) is 99 however many of those cells are empty. To count filled cells use COUNTA; to count numbers, COUNT.

Whole columns

A whole-column reference like A:A is bounded to the part of the sheet that holds data, so ROWS(A:A) gives the height of the used area rather than the full 1,048,576 rows Excel reports. Use an explicit range when the full grid size is what you mean.

Excel compatibility

Matches Excel for ranges. Whole-column references such as A:A are bounded to the data in the sheet, so ROWS(A:A) is the used height, not 1,048,576.

Related functions

Last updated