Function Name: choosecols

Change me Function

Syntax:

=CHOOSECOLS(array,col_num1,[col_num2],…)

The CHOOSECOLS function syntax has the following arguments:

  • array       The array containing the columns to be returned in the new array. Required.
  • col_num1       The first column to be returned. Required.
  • col_num2      Additional columns to be returned. Optional.

Purpose:

  • Data Analysis: Focus on specific columns that are relevant to your analysis.
  • Reporting: Create reports that dynamically update based on selected columns.
  • Data Cleaning: Extract and clean specific columns from a dataset.
  • Examples

    Copy the example data in the following table and paste it in cell A1 of a new Excel worksheet. If you need to, you can adjust the column widths to see all the data.

    Example 1

    Returns an array of columns 1, 3, 5, and 1 again from the array in the range A2:E7.


    Data     
    12345 
    678910 
    1112131415 
    1617181920 
    2122232425 
    2627282930 
    Formulas     
    =CHOOSECOLS(A2:E7,1,3,5,1)
    Example 2

    Returns an array of the last two columns from the array in the range A2:D7 in the order of column three and then column four.

    Data   
    121314
    341516
    561718
    781920
    9102122
    11122324
    Formulas   
    =CHOOSECOLS(A2:D7,3,4
    Example 3

    Returns an array of the last two columns from the array in the range A2:D7 in the order of column four and then column three.

    Data

       

    1

    2

    13

    14

    3

    4

    15

    16

    5

    6

    17

    18

    7

    8

    19

    20

    9

    10

    21

    22

    11

    12

    23

    24

    Formulas

     

     

     

    =CHOOSECOLS(A2:D7,-1,-2)