COLUMNS in Apple Numbers: Count Range Width and Exclude Header Columns
Count columns in a Numbers table range, distinguish data/header columns, and use the optional Apple-specific headers flag.
Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in Apple Numbers. How formula examples are checked
Quick answer
COLUMNS returns the number of columns spanned by a range of cells. In Apple Numbers, it has an optional header-column exclusion setting that many competing spreadsheet functions do not have: 1 excludes header columns, whereas 0 or leaving the argument out includes them. [A1]
=COLUMNS(B2:D6)
Expected: 3, representing columns B, C and D. [A1, M1]
Exact Apple syntax and argument defaults
=COLUMNS(range, headers)
| Argument | Required? | Meaning | Default |
|---|---|---|---|
range |
Yes | A reference to one cell range; cells may contain any values. | None |
headers |
No | 0 includes header columns; 1 excludes them. | 0 (include) |
These are Numbers argument rules. They must not be borrowed from Excel or Google Sheets, which document COLUMNS with one required range/array argument and no corresponding Numbers header flag. [A1, X1, G1]
Reproducible table: total width and data-only width
Create a table named Orders with columns A:D and six rows. Explicitly set one header column A, not additional header columns. For clear labels, use row 1 for column headings if desired; the column-header flag is what matters for the following results.
| Row | A (Order ID, header column) | B (Item) | C (Units) | D (Price) |
|---|---|---|---|---|
| 1 | Order ID | Item | Units | Price |
| 2 | O-01 | Pen | 4 | 3 |
| 3 | O-02 | Pad | 2 | 6 |
| 4 | O-03 | Clip | 8 | 1 |
| 5 | O-04 | Ink | 1 | 12 |
| 6 | O-05 | Tape | 3 | 4 |
Enter the results into a separate Analysis table so that Orders remains exactly four columns wide. Use the Formula Editor to select ranges from the Orders table; a cross-table reference needs the Orders table qualifier (for instance Orders::B2:D6). The short reference notation below identifies ranges in Orders, not in the Analysis table; do not paste these short formulas unqualified into Analysis. [R1]
| Formula | Expected | Explanation |
|---|---|---|
=COLUMNS(B2:D6) |
3 | Range spans B, C, and D. |
=COLUMNS(A1:D6) |
4 | Counts A through D, including the header column by default. |
=COLUMNS(A1:D6,0) |
4 | Explicitly includes the header column. |
=COLUMNS(A1:D6,1) |
3 | Excludes header column A. |
=COLUMNS(B2:B6) |
1 | A tall range can still be one column wide. |
These are independent geometric checks based on a defined table configuration and Apple’s official header-mode description, not observed results from Numbers. [A1, M1]
Advanced: range expands with the table’s width
Apple documents the whole-row reference =COLUMNS(5:5). In the example four-column Orders table, it counts 4 columns; add one table column and the expected width becomes 5. Use this pattern when a summary must reflect the entire current table row, not a fixed A:D block. [A1, M2]
=COLUMNS(5:5)
Expected in the configured four-column table: 4 (include the header column by default).
Advanced: a rectangular block’s capacity
If you need to know how many cell positions are available in a selected range, multiply its height and width:
=ROWS(B2:B6)*COLUMNS(B2:D6)
Expected: 5 × 3 = 15 cells in the rectangle. An empty cell still occupies a position; this isn’t equivalent to counting nonblank entries. This is a calculated expression built from two official range-dimension functions. [A1, A2, M3]
COLUMNS versus COLUMN
COLUMN(D4) returns 4: the position of column D. COLUMNS(B2:D6) returns 3: the width of B through D. They answer different questions even when the range ends at column D. [A1, A3]
Troubleshooting and limits
- Unexpected extra column: if header column A is included and you omit
headers, COLUMNS includes A. Use mode1only when your range actually includes the header column you intend to omit. [A1] - Wrong count with
headers=1: check how many header columns exist and whether your selected range intersects them; the flag is not a fixed subtraction of one for every possible table. [A1] - Blank columns count: COLUMNS measures the width of a range, not the number of filled columns. For content questions, use a relevant counting formula instead. [A1]
- Copied formula has wrong table: use the Formula Editor to inspect references; cross-table names may appear with
::. [R1] - Array constant in Excel isn’t Numbers evidence: Excel explicitly documents array-constant examples; Apple’s COLUMNS page requires a range reference. Prefer an actual Numbers table range. [A1, X1]
- Exact errors remain to be tested: the Apple page does not specify every invalid-input error message; do not promise a particular code without native execution. [A1]
Compatibility with Excel and Google Sheets
Plain-range counts such as COLUMNS(B2:D6) have the same mathematical width in the three products, but the documented signatures differ: Apple has COLUMNS(range, headers) while Excel/Sheets document a single required argument. An Apple formula using ,1 to exclude header columns should not be copied unchanged into Excel or Sheets. [A1, X1, G1]
Related official documentation
- Apple — COLUMNS — A1, exact syntax, header values and whole-row example; accessed 2026-10-12.
- Apple — ROWS — A2, range height; accessed 2026-10-12.
- Apple — COLUMN — A3, coordinate vs count; accessed 2026-10-12.
- Apple — Refer to cells — R1, qualified refs; accessed 2026-10-12.
- Microsoft — COLUMNS — X1, Excel syntax and arrays; accessed 2026-10-12.
- Google — COLUMNS — G1, Sheets syntax; accessed 2026-10-12.
Apple Numbers version, table references, and regional settings
This guide was checked against Apple’s English Formulas and Functions Help on 12 October 2026. The official function page is a Numbers Help 15.4 URL unless noted otherwise. Apple’s current Mac user guide identifies Numbers 15.4; the function’s first-ever release and behaviour in older Numbers versions have not been independently established. Apple also describes the Functions Browser in Numbers on Mac, iPhone, iPad, and iCloud.com; do not assume all historical versions are identical. [V1]
Numbers formulas operate inside tables, not against an undifferentiated worksheet grid. For the examples, create one table with the stated row/column dimensions; a plain reference such as B7 points into the formula’s table. To refer to a different table, Apple’s syntax uses Table 2::B7; for another sheet, it may be Sheet 2::Table 1::C5. In the Formula Editor, selecting the source cell is safer than typing a cross-table name manually. References inside a range use a colon, e.g. B2:D6. [R1]
The copyable formulas use English-language function names and comma separators as displayed in the cited English Apple help. Apple’s language/region settings affect number, currency, and date formatting; the exact argument separator and localized function spelling for every locale were not natively tested. If your Numbers Formula Editor presents different separators, use what it shows rather than copying punctuation blindly. For these reference-and-Boolean functions, changing the decimal locale does not change the intended row/column count or TRUE/FALSE logic. [L1]
Validation distinction: Numbers was not run. Outputs labelled expected below are either explicitly illustrated in Apple’s documentation or independently calculated from the example’s defined table coordinates/logic. No screenshot or application-observed result is claimed.
Verification and limitations
Official syntax was checked against Apple documentation. Worked values are independently calculated expectations, not native application results. Native Apple Numbers execution, screenshots, historical-version behavior and exact error messages were not tested.
Common source and calculation notes
[V1] Apple Numbers version history; [L1] Apple function syntax and locale separators. Checked 13 October 2026. M1–M3 identify the independent coordinate/count calculations explained beside the examples, not native application measurements.