Syntax
| Parameter | Description |
|---|---|
| array | Parameter of the CHOOSECOLS function. |
| col_num1 | Parameter of the CHOOSECOLS function. |
| [col_num2 | (Optional.) Parameter of the CHOOSECOLS function. |
| ...] | Parameter of the CHOOSECOLS function. |
Examples
Pick columns 1 and 4 from a table
=CHOOSECOLS(A1:F100, 1, 4)
Reorder columns
=CHOOSECOLS(A1:D50, 3, 1, 4, 2)
Last column shortcut
=CHOOSECOLS(A1:F100, -1)
Common Errors
A column number is zero or exceeds the number of columns in the array (in either positive or negative direction).
Output cells are not empty.
Tips
Use -1 for the last column, -2 for second-to-last, etc. This makes formulas resilient to arrays that might change width.
You can repeat a column number: CHOOSECOLS(data, 1, 1, 2) returns column 1 twice followed by column 2. Useful for creating specific layouts.
=CHOOSECOLS(FILTER(A1:F100, C1:C100>50000), 1, 3, 5) filters rows first, then picks only the columns you want. A two-step data extraction.
Try CHOOSECOLS in Viztab
Import your data and use CHOOSECOLS with 370+ other formulas. No signup required.
Open Viztab