COLUMNS in Collabora Office: Count Range Width and Audit Table Shapes
Count columns in Collabora Calc ranges, compare shape with worksheet coordinates, and build copy-across position counters without counting populated cells.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: COLUMNS counts how many columns a rectangular reference spans. For C5:F8, it returns 4. The starting column number is irrelevant to the count; moving a four-column rectangle elsewhere still leaves it four columns wide.
Availability and version history
- Introduced: the original Collabora release and launch date are not established by the reviewed sources.
- Availability: documented in Collabora Office 26.04 desktop help.
- Platform scope: online and mobile deployment support is not inferred from the desktop documentation.
- Checked: October 14, 2026. Function-specific documentation and independent controls; no native Collabora execution.
Syntax and reference scope
=COLUMNS(Array)
The required argument is a cell-range reference; the official help also documents a single cell and a named range. A single cell has one column.
Do not confuse COLUMNS with COLUMN. The ordinary expression COLUMN(C5:F8) returns coordinate 3, whereas COLUMNS(C5:F8) returns width 4.
The examples use straightforward contiguous references. The short source does not specify how every multiple-area, invalid-text or 3-D reference is handled, so those cases remain outside the verified documentation scope.
Example 1: calculate widths from endpoints
| Formula | Expected result | Independent count |
|---|---|---|
=COLUMNS(B5) |
1 | One cell |
=COLUMNS(C5:F8) |
4 | C, D, E, F |
=COLUMNS(Z2:AB9) |
3 | Z, AA, AB |
=COLUMNS(A10:C10) |
3 | A, B, C |
The general coordinate check for a contiguous rectangle is ending-column-number minus starting-column-number plus one. Z=26 and AB=28, so the third result is 28-26+1 = 3.
The number of rows does not multiply this result. Z2:AB9 has eight rows and three columns; COLUMNS returns 3 rather than 24.
Example 2: distinguish shape from contents
Create a small table in C5:F8 with any mixture of numbers, labels and empty cells:
=COLUMNS(C5:F8)
=ROWS(C5:F8)
Expected results are 4 and 4. Their product is 16, the number of cell positions in the rectangle.
Clearing a cell or replacing a number with text does not change the endpoints of the reference. COLUMNS remains a width calculation, not a count of usable measurements or nonempty headers.
If a report needs the number of populated columns, it must first define what counts as populated. A formula returning empty text, a header-only column and a column with numeric zero can require different rules. COLUMNS alone makes none of those data-quality decisions.
Advanced example: create a copy-across position counter
In C2 enter:
=COLUMNS($C$5:C5)
Fill across through G2. The referenced intervals expand from C5:C5 through C5:G5, producing 1, 2, 3, 4 and 5.
The left endpoint is anchored while the right endpoint moves with the copied formula. With both endpoints relative, each copied range could remain only one column wide, producing repeated 1s instead of a sequence.
This construction counts positions in an expanding reference. It does not inspect the labels in C5:G5 or require the cells to contain consecutive numbers. Keep the counter outside the data rows so it remains easy to audit.
Advanced example: compare two report shapes
Suppose one report occupies A2:D11 and another occupies G2:J6:
=COLUMNS(A2:D11)=COLUMNS(G2:J6)
Expected result: TRUE, because both ranges are four columns wide. Their row counts are 10 and 5, so equal width does not establish equal shape.
To compare both dimensions, use:
=AND(COLUMNS(A2:D11)=COLUMNS(G2:J6);ROWS(A2:D11)=ROWS(G2:J6))
Expected result: FALSE. This structural control still does not prove that matching columns have the same meaning or units. A width of four could describe four unrelated fields.
Named ranges and practical limits
If ReportBlock is defined as C5:F8, =COLUMNS(ReportBlock) has expected result 4, following the documented named-range rule. Changing the name’s referenced width changes the structural input even if the formula text stays the same.
Use ROWS for height, COLUMN for an absolute coordinate, and AREAS for separately grouped ranges. These functions answer different reference questions; none should be substituted merely because each returns a count-like number.
References and verification
Complete function-specific documentation reviewed. Worked outputs are independently modeled reference, text or arithmetic controls, not captured native application results. Unverified entry, conversion and error boundaries retain their stated scope.