ReferenceFunctionsLookup Functions
CHOOSECOLS
CHOOSECOLS: Returns selected columns from an array or range.
Summary
CHOOSECOLS builds a new spilled array containing only the requested columns, in the
order provided.
Remarks
- Column indexes are 1-based; negative indexes count from the end (
-1is last column). - Repeated indexes are allowed and duplicate columns in the output.
- Index
0or out-of-bounds indexes return#VALUE!. - The result spills as an array unless it collapses to a single cell.
Examples
Select first and third columns
Grid
| Cell | Value | |
|---|---|---|
Formula
=
Result
Not evaluated yet.
Expected
[["Name","Score"],["Ana",91]]
Select the last column with a negative index
Grid
| Cell | Value | |
|---|---|---|
Formula
=
Result
Not evaluated yet.
Expected
30
Related functions
FAQ
How do negative column indexes work?
Negative indexes count from the right edge of the array, so -1 selects the last column, -2 the second-to-last, and so on.
What triggers #VALUE! in CHOOSECOLS?
Index 0 and any index whose absolute position falls outside the source width return #VALUE!.
Runtime metadata
Category
Lookup
Signature
CHOOSECOLS(arg1: Range | Any (Range), arg2…: Number)Arity
min 2, max variadic
Arguments
arg1Range | Any · Range
arg2repeating 1Number · Scalar · coercion NumberLenientText
Caps
PURELOOKUP
Source