Skip to content
Excel

COLUMNS function in Excel

Returns the number of columns in a reference

=COLUMNS(array)

COLUMNS syntax and parameters

One argument, one required.

  • arrayanyRequired

    An array or array formula, or a reference to a range of cells for which you want the number of columns.

COLUMNS examples

Formulas you'll actually reuse.

  1. How many months a projection row spans:

    =COLUMNS(B2:M2)

    Result12

  2. The last value in a row — INDEX aimed at the final column:

    =INDEX(B2:M2, COLUMNS(B2:M2))

    Result13482.5

COLUMNS in Google Sheets

Same name — your formula ports as-is.

Try COLUMNS in the playground

Edit the example — nothing to install.

Preloaded with the COLUMNS formula from Example 1 — change anything and watch it respond.

Loading the editor…