Formualizer Docs
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 (-1 is last column).
  • Repeated indexes are allowed and duplicate columns in the output.
  • Index 0 or 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
CellValue
Formula
=
Result
Not evaluated yet.
Expected
[["Name","Score"],["Ana",91]]
Select the last column with a negative index
Grid
CellValue
Formula
=
Result
Not evaluated yet.
Expected
30

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

arg1

Range | Any · Range

arg2repeating 1

Number · Scalar · coercion NumberLenientText

Caps

PURELOOKUP

Source

On this page