Google Sheets
COLUMNS function in Google Sheets
Returns the number of columns in a specified array or range.
=COLUMNS(range)COLUMNS syntax and parameters
One argument, one required.
- rangerangeRequired
The range whose column count will be returned
COLUMNS examples
Formulas you'll actually reuse.
How many months a projection row spans:
=COLUMNS(B2:M2)Result
12The last value in a row — INDEX aimed at the final column:
=INDEX(B2:M2, COLUMNS(B2:M2))Result
13482.5
COLUMNS in Excel
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…
Related functions
More ways Google Sheets gets this done.
- ADDRESSReturns a cell reference as a string.LookupExcel
- CHOOSEReturns an element from a list of choices based on index.LookupExcel
- COLUMNReturns the column number of a specified cell, with `A=1`.LookupExcel
- FORMULATEXTReturns the formula as a string. .LookupExcel
- GETPIVOTDATAExtracts an aggregated value from a pivot table that corresponds to the specified row and column headings.LookupExcel
- HLOOKUPHorizontal lookup. Searches across the first row of a range for a key and returns the value of a specified cell in the column found.LookupExcel