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 1Returns an array of columns 1, 3, 5, and 1 again from the array in the range A2:E7.
Data 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Formulas =CHOOSECOLS(A2:E7,1,3,5,1) Example 2Returns 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 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,3,4 Example 3Returns 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)