Exceljet

Quick, clean, and to the point

Excel CHOOSECOLS Function

Excel CHOOSECOLS function
Summary 

The Excel CHOOSECOLS function returns specific columns from an array or range. The columns to return are provided as numbers in separate arguments. Each number corresponds to the numeric index of a column in the given array.

Purpose 
Return specific columns from an array
Return value 
Extracted columns in a single array
Syntax 
=CHOOSECOLS (array, col_num1, [col_num2], ...)
Arguments 
  • array - The array to extract columns from.
  • col_num1 - The numeric index of the first column to return.
  • col_num2 - [optional] The numeric index of the second column to return.
Version 
Usage notes 

The Excel CHOOSECOLS function returns specific columns from an array or range. The columns to return are provided as numbers in separate arguments. Each number corresponds to the numeric index of a column in the source array.

The first argument in the CHOOSECOLS function is array. Array can be a range, or an array from another formula. Additional arguments are in the form col_num1col_num2col_num3, etc. Each number represents a specific column to extract from the array, and should be supplied as a whole number.

Basic usage

To get columns 1 and 3 from an array, you can use CHOOSECOLS like this:

=CHOOSECOLS(array,1,3) // columns 1 and 3

To get the same two columns in reverse order:

=CHOOSECOLS(array,3,1) // columns 3 and 1

The result from CHOOSECOLS is always a single array.

With array constants

Another option for specifying which columns to return is to use an array constant like {1,2,3} as the second argument (col_num1). In the example below, the formula in H3 is:

=CHOOSECOLS(B3:F9,{1,3,5})

With the array constant {1,3,5} given as the second argument, CHOOSECOLS returns columns 1, 3, and 5:

CHOOSECOLS with array constant

The array constant provided can be in the form {1,2,3} or {1;2;3}.

With arrays

As seen above, you can use an array constant as the second argument in CHOOSECOLS to indicate columns. You can also use an array created with a formula. For example, the formula below uses CHOOSECOLS and the SEQUENCE function to reverse the order of columns in an array:

=CHOOSECOLS(array,SEQUENCE(COLUMNS(array),,COLUMNS(array),-1))

When given a 3-column range or array, SEQUENCE returns {3;2;1} to CHOOSECOLS, and CHOOSECOLS returns the 3 columns in reverse order:

CHOOSECOLS function - reverse column order

The formula returns all the columns in Array, starting with the last column.

Download 100+ Important Excel Functions

Get over 100 Excel Functions you should know in one handy PDF.