1. Home
  2. Functions
  3. Array
  4. CHOOSECOLS

CHOOSECOLS function

Returns the given columns of an array (negative numbers count from the end).

Syntax

=CHOOSECOLS(array, col_num1, [col_num2], ...)

Arguments

ArgumentRequiredDescription
arrayRequiredThe range or array
col_num1RequiredA column number
col_num2OptionalMore column numbers

How to use CHOOSECOLS

When CHOOSECOLS returns more than one value, the result spills into the cells below and to the right. Keep those cells empty, or you get #SPILL!.

CHOOSECOLS takes 2 required arguments and 1 optional argument, and accepts more values in the same pattern. Type =CHOOSECOLS( in a cell and SheetsBat shows the arguments as you go. Optional arguments are shown in square brackets; leave them out to use their default.

Examples

Each result below was calculated by the SheetsBat formula engine.

=CHOOSECOLS({1,2,3;4,5,6}, 1, 3)Result 2 by 2 array
Spilled result
AB
113
246
=CHOOSECOLS({1,2,3}, -1)Result 3
=CHOOSECOLS({1,2}, 0)Result #VALUE!

Every formula, right in your browser

SheetsBat calculates 536 functions, with charts, pivot tables and live collaboration. Free to start.