Lookup

COLUMNS

Definition

COLUMNS returns how many columns are in a range.

Syntax

=COLUMNS(array)

Arguments

Argument Meaning
array The range whose width to count, such as A3:E3.

Worked example

A header row occupies A3:E3. The first and last cells are filled; the cells between them may be empty.

A B C D E
start end

Formula: =COLUMNS(A3:E3)

Result: 5. A3:E3 is five columns wide, including the empty cells.

Practice

Cells A2 and D2 hold 1. In E2, write a formula that returns how many columns are in A2:D2.

  1. In E2, write a COLUMNS formula for A2:D2.
Step 1 of 2
Formulas here use English function names, such as SUM, and a period as the decimal separator, in every language.
Loading the sheet…

Related functions

ROWS is the matching height. COUNT counts numeric cells, which can be fewer than the columns in the range.

Common mistake

Expecting COLUMNS to skip blanks: COLUMNS(A2:D2) is 4 even when B2 and C2 are empty.

Related functions

These links are related functions.