CHOOSECOLS
Return specific columns from an array or range with Excel's CHOOSECOLS function.
Spreadsheet editor
Spreadsheet editor
Syntax
=CHOOSECOLS(array, col_num1, [col_num2], ...)
Returns: Array Arguments
| Argument | Required | Description |
|---|---|---|
| array | Yes | The source range or array that contains the columns you want to return. |
| col_num1 | Yes | The position of the first column to return. Count from 1 on the left, or use a negative number to count from the right. |
| col_num2 | No | Additional column positions to return, listed in the order you want them. |
About
Use CHOOSECOLS when you only need a few columns from a wide table, such as showing just the name and total from a sales export. You can also reorder columns on the fly by listing positions in a different order, like 3, 1, 2. Negative numbers count from the right, so -1 grabs the last column, which is useful when the number of columns can change.
CHOOSECOLS works well with other dynamic array functions. Pair it with FILTER to narrow rows first, then keep only the columns you want, or combine it with SORT to order rows before trimming fields. To grab rows by position instead of columns, see TAKE.
Exercises using CHOOSECOLS
Examples
Grab the last column from the right
Spreadsheet editor
Asking for a column that does not exist
Spreadsheet editor
Filter rows, then keep two columns
Spreadsheet editor
Watch out for
Counting from worksheet letters
People assume col_num matches column letters on the sheet, so a table starting at column D feels like it should use 4.
→ Column numbers are positions inside the array you pass in, not sheet columns. If your array starts at column D, its first column is still 1 inside CHOOSECOLS.
Asking for a column that does not exist
Using a number larger than the column count, or 0, returns a #VALUE! error and nothing spills.
→ Keep each col_num between 1 and the number of columns in the array (or use negative numbers within the same range). Use COLUMNS to check how many columns your array has.
Output blocked by existing data
CHOOSECOLS spills its result, so if a cell in the output area is occupied you get a #SPILL! error.
→ Clear the cells below and to the right of the formula so the array has room to expand into empty space.