ROWS Function (OpenOffice Calc)
Learn the ROWS function in Apache OpenOffice Calc: Returns the number of rows in a reference or array.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Availability and version history
- Introduced: Documented by Apache OpenOffice 4.1.16; original introduction not established.
- Availability: Supported in Apache OpenOffice 4.1.16, verified against its function registry. This identifies a supported release, not a final working version.
- Scope: Desktop Calc, using the English function name. Availability in other spreadsheet applications is separate.
- Checked: 2026-10-14 — function reference; versioned support. Documentation/source check; not a new native test. Existing example-specific test claims below retain their stated scope.
ROWS measures the height of a reference or array, including empty rows. It does not count nonempty records, visible records or numeric values. A rectangular A1:C5 range has five rows regardless of how many of its fifteen cells contain data.
Syntax and arguments
=ROWS(reference_or_array)
One reference, named reference or array is required in the documented syntax. A single cell has one row. For an ordinary one-sheet rectangular range, the result is last row minus first row plus one. The pinned interpreter reads reference endpoints or matrix dimensions rather than scanning the contents. Examples use English function names and semicolon separators.
Worked example
Use this small practice sheet for the ranges referenced in the formula:
| Row | A (Quantity) | B (Amount) | C (Category) |
|---|---|---|---|
| 1 | 1 | 10 | apple |
| 2 | 2 | 20 | pear |
| 3 | 3 | 30 | apple |
| 4 | 4 | 40 | pear |
| 5 | 5 | 50 | apple |
=ROWS(A1:C5)
Expected result: 5.
Why it works: Return the number of rows in a range. The specified sample table supplies the referenced cells.
Example evidence
This original example retains its historical comparable LibreOffice 25.2 checking scope; it was not an OpenOffice native test. The reference controls below are independently checked source/documentation expectations, not new application captures.
Additional reference controls
| Formula | Reference result |
|---|---|
=ROWS(A1:C5) |
5 |
=ROWS(D8) |
1 |
=ROWS(A3:B5) |
3 |
=ROWS(G4:G6) |
3 |
=ROWS(A2:E2) |
1 |
=ROWS(A2:A8) |
7 |
Quoted results are text. ERROR means the source’s error path without claiming a newly observed localized error message. Range formulas here use ordinary scalar entry unless the array form is explicitly discussed.
Practical worksheet
Preserve the five-row practice table above. In E1 enter =ROWS(A1:C5); the result is 5. In E2 enter =COLUMNS(A1:C5); the result is 3. In E3 enter =E1*E2; the result is 15 cells. Clearing one or all values from A1:C5 does not change the geometry of that explicit reference.
For a running position, put =ROWS($A$2:A2) in D2 and fill through D6. Results are 1,2,3,4,5 because only the bottom endpoint expands. This formula counts the height of a growing range, not the number of populated or matching rows.
Advanced applications and distinctions
Check an inclusive endpoint. A2:A8 has seven rows, not six: 8-2+1=7. Comparing ROW(A8)-ROW(A2)+1 gives the same geometric result for a normal ordered single-sheet range. The +1 accounts for the starting row.
Understand multiple-area names. The official reference documents a named multi-area reference made from A1:A3 and C1:C4. ROWS of that named reference returns 7 by adding 3 and 4. It does not deduplicate worksheet row numbers that appear in both areas. This is not a claim that arbitrary comma-separated range syntax from another application works unchanged.
Check matrix dimensions separately from data. A two-column, three-row array has three rows even if an element is empty or textual. The interpreter has a separate matrix branch that reads its dimensions. These are geometry rules, not a native array-construction or dynamic-spill test.
Errors and troubleshooting
A quoted address such as “A1:C5” is text, not the same argument as the range A1:C5. A bare numeric scalar is also not a documented substitute for a reference in this function. Unsupported stack types follow the interpreter’s illegal-parameter path. Existing reference errors need correction rather than a fabricated zero count.
ROWS does not shrink when rows are filtered out or hidden: the ordinary explicit range still spans the same row coordinates. Use an operation designed for visible or qualifying records when that is the actual question. Do not equate the range’s capacity with the number of entered records.
The number of rows and the number of cells coincide only for a one-column rectangle. Multiply ROWS by COLUMNS for total cells in a simple rectangle, but do not assume multiplying summed dimensions gives the union size of a multi-area name. Three-dimensional references have additional source rules and are outside these single-sheet worksheets. No native name-definition, import or save/reload workflow was performed.
Related functions
Documentation and verification
The official ROWS function reference was retrieved October 15, 2026. The pinned 4.1.16 interpreter and function descriptions retain their October 13 source retrieval dates. These support scalar branch selection, reference dimensions, lookup modes and the limitations stated here. Original introduction and last functioning version remain unestablished, separate from documented release support. No new native, GUI, array-entry or import/export test was performed.