# CHOOSECOLS Function

> Return selected columns of an array or range with CHOOSECOLS in TX Sheet Control: column numbers, negative indexes from the end, spilling and #VALUE!.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Function
- **Path:** TX Sheet Control > API Reference > Formula Functions > CHOOSECOLS Function
- **223 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/choosecols/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/choosecols/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/choosecols/llms-full.txt

---

Return the specified columns of an array or range. `array` is the array or range, and each `index` argument is the number of a column to return: 1 is the first column, and a negative number counts from the last column, so -1 is the last one. The columns are returned in the order of the arguments, and the result spills into the neighboring cells. An index of 0 or beyond the number of columns returns `#VALUE!`.

### Syntax

```text
CHOOSECOLS(array, index1, index2)
```

Category: Lookup. Minimum arguments: 2. Maximum arguments: 255.

Available for supported offline calculation.

### Examples

```text
=CHOOSECOLS({1,2;3,4},2)
```

The formula returns the second column, the values 2 and 4.

Cell and range examples require appropriate input values in the referenced cells. Handle invalid arguments, formula errors and array and spill constraints.

### See Also

- [Formulas](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/formulas/llms-full.txt)
- [Custom Functions and Formula Data](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/custom-functions/llms-full.txt)

---

## Nearby

- **Previous:** [CHOOSE Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/choose/llms-full.txt)
- **Next:** [CHOOSEROWS Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/chooserows/llms-full.txt)
