Skip to content

CHOOSECOLS

Returns the columns you name from a range or array, in the order you name them. Negative numbers count from the right.

Syntax

=CHOOSECOLS(, , [col_num2], …)

Dynamic arrays

Excel for Microsoft 365, Excel 2024 and later, and Excel for the web. Not available in Excel 2021 or earlier.

Try it

Edit the formula in F2 or change the inputs. The sheet recalculates as you type.

F2
A
B
C
D
E
F
G
H
1
Staff ID
Dept
Start year
Salary
2
E-101
Ops
2019
41,000
E-101
41000
3
E-102
Finance
2021
52,000
E-102
52000
4
E-103
Ops
2020
38,500
E-103
38500
5
E-104
IT
2018
61,000
E-104
61000
6
E-105
Finance
2022
47,500
E-105
47500
7
E-106
IT
2023
55,000
E-106
55000
8

F2 =CHOOSECOLS(A2:D7,1,4) returns E-101, 41000; E-102, 52000; E-103, 38500; E-104, 61000; E-105, 47500; E-106, 55000

How CHOOSECOLS works

CHOOSECOLS picks columns out of a table and returns just those. You can pick them in any order, repeat them, and count from the right. It is the quick way to cut a wide table down to the columns a report needs.

The arguments

  • array is the block to choose from.
  • col_num1, col_num2, … are positions inside that block, counted from 1. In A2:D7, 1 is column A and 4 is column D. A negative number counts back from the end: -1 is the last column and -2 the one before it.

The result has one column for each number you give, in that order. =CHOOSECOLS(A2:D7,4,1) puts the salary first and the staff ID second. The numbers can come from an array constant, {1,4}, or from a calculation such as SEQUENCE(1,2).

Why not just reference the columns?

You could write =A2:A7 and =D2:D7 side by side, but then every column is its own formula and you can't pass the result into another function. CHOOSECOLS returns one array that you can sort, filter or stack. For example, =SORT(CHOOSECOLS(A2:D7,1,4),2,-1) ranks staff by salary and shows only two columns.

Combining it with FILTER

FILTER returns every column of the rows it keeps. To return only some of those columns, nest CHOOSECOLS around it:

=CHOOSECOLS(FILTER(A2:D7,B2:B7="IT"),1,4)

This returns the ID and salary of the IT staff. Because the test is made on the full table, you can filter on a column that you don't show.

Counting from the right

Negative numbers are useful when the table can gain columns. =CHOOSECOLS(A2:H50,-1) always returns the last column, even if someone inserts another one before it. A fixed number would silently return the wrong column.

Errors

A column number of 0, or a number beyond the width of the array, returns #VALUE!. In a 4-column array, both CHOOSECOLS(array,5) and CHOOSECOLS(array,-5) fail.

Results are values

The result is a spilled array of values, not a live reference to the original cells. It follows the source when the source changes, but you can't format the source cells by formatting the result.

If you need to remove columns instead of choosing them, DROP is shorter. To keep the first few columns, use TAKE. To pick rows instead, use CHOOSEROWS.

CHOOSECOLS needs Microsoft 365, Excel 2024 or later, or Excel for the web. Earlier versions can use INDEX with an array of column numbers.

Arguments

array
The range or array to take columns from. It can be the result of another formula, such as FILTER(...).
col_num1
The position of the first column to return, counted from 1 within array. A negative number counts from the right, so -1 is the last column.
col_num2, …optional
More column numbers. The columns come back in the order you list them, and the same column may appear more than once.

Examples

Each example is a live sheet. Change the inputs or the formula and watch the result.

Example 1

Keep two columns: ID and salary

F2 =CHOOSECOLS(A2:D7,1,4)

Result: E-101, 41000; E-102, 52000; E-103, 38500; E-104, 61000; E-105, 47500; E-106, 55000

Columns 1 and 4 of A2:D7 are the staff ID and the salary. The department and start year are left out.

F2
A
B
C
D
E
F
G
H
1
Staff ID
Dept
Start year
Salary
2
E-101
Ops
2019
41,000
E-101
41000
3
E-102
Finance
2021
52,000
E-102
52000
4
E-103
Ops
2020
38,500
E-103
38500
5
E-104
IT
2018
61,000
E-104
61000
6
E-105
Finance
2022
47,500
E-105
47500
7
E-106
IT
2023
55,000
E-106
55000
8

F2 =CHOOSECOLS(A2:D7,1,4) returns E-101, 41000; E-102, 52000; E-103, 38500; E-104, 61000; E-105, 47500; E-106, 55000

Example 2

Change the order: salary first

F2 =CHOOSECOLS(A2:D7,4,1)

Result: 41000, E-101; 52000, E-102; 38500, E-103; 61000, E-104; 47500, E-105; 55000, E-106

The columns come back in the order you list them, so naming 4 before 1 swaps them.

F2
A
B
C
D
E
F
G
H
1
Staff ID
Dept
Start year
Salary
2
E-101
Ops
2019
41000
41000
E-101
3
E-102
Finance
2021
52000
52000
E-102
4
E-103
Ops
2020
38500
38500
E-103
5
E-104
IT
2018
61000
61000
E-104
6
E-105
Finance
2022
47500
47500
E-105
7
E-106
IT
2023
55000
55000
E-106
8

F2 =CHOOSECOLS(A2:D7,4,1) returns 41000, E-101; 52000, E-102; 38500, E-103; 61000, E-104; 47500, E-105; 55000, E-106

Example 3

Count from the right: the last column

F2 =CHOOSECOLS(A2:D7,-1)

Result: 41000; 52000; 38500; 61000; 47500; 55000

-1 means the last column of the array. If a column is added to the end of the table later, this formula still returns the last one.

F2
A
B
C
D
E
F
G
H
1
Staff ID
Dept
Start year
Salary
2
E-101
Ops
2019
41000
41000
3
E-102
Finance
2021
52000
52000
4
E-103
Ops
2020
38500
38500
5
E-104
IT
2018
61000
61000
6
E-105
Finance
2022
47500
47500
7
E-106
IT
2023
55000
55000
8

F2 =CHOOSECOLS(A2:D7,-1) returns 41000; 52000; 38500; 61000; 47500; 55000

Example 4

Filter first, then choose the columns to show

F2 =CHOOSECOLS(FILTER(A2:D7,B2:B7="IT"),1,4)

Result: E-104, 61000; E-106, 55000

FILTER keeps the two IT rows with all four columns, and CHOOSECOLS then trims them to ID and salary.

F2
A
B
C
D
E
F
G
H
1
Staff ID
Dept
Start year
Salary
2
E-101
Ops
2019
41000
E-104
61000
3
E-102
Finance
2021
52000
E-106
55000
4
E-103
Ops
2020
38500
5
E-104
IT
2018
61000
6
E-105
Finance
2022
47500
7
E-106
IT
2023
55000
8

F2 =CHOOSECOLS(FILTER(A2:D7,B2:B7="IT"),1,4) returns E-104, 61000; E-106, 55000

Your turn.

Solve it in the sheet. Every answer is checked, with hints if you need them.

Task 1 of 2

In F2, return the order number and the number of units for every order, using columns A and C only.

Answer in F2.

F2
A
B
C
D
E
F
G
H
I
J
1
Order
Region
Units
Price
2
SO-71
North
12
8.50
3
SO-72
South
30
7.25
4
SO-73
East
18
9.00
5
SO-74
West
25
6.50
6
SO-75
North
40
8.50
7
SO-76
East
9
9.00
8
SO-77
South
22
7.25
9

Common mistakes

  • #VALUE! means a column number is 0 or reaches past the array. In a four-column array, 5 and -5 both fail, and so does 0. Count the columns in what you pass in.
  • The numbers count inside array, not by sheet column letter. For =CHOOSECOLS(C2:F9,2), 2 returns column D, the second column of C:F.
  • A fixed number breaks quietly when someone inserts a column in the source range. Use negative numbers for columns at the end, or look the position up with MATCH.
  • Only the columns you name come back, so the header must be inside the range if you want it. Start the range at the header row, such as A1:D7, or add a header with VSTACK.
  • The result is an array of values. It spills like any dynamic array and returns #SPILL! if something is in the way.

Questions people ask

What does a negative number do in CHOOSECOLS?

It counts from the right. -1 is the last column, -2 the one before it, and so on. The column order in the result follows the order of your numbers.

Can CHOOSECOLS return columns in a different order?

Yes. List the numbers in the order you want: `=CHOOSECOLS(A2:D7,4,2,1)` returns the fourth column, then the second, then the first.

How do I return non-adjacent columns in Excel?

Use `=CHOOSECOLS(A2:H20,1,3,8)`. Before CHOOSECOLS you had to use INDEX with an array of numbers or place copies side by side.

What is the difference between CHOOSECOLS and TAKE?

TAKE returns a block from the start or end of the array. CHOOSECOLS returns any columns you name, in any order, including ones from the middle.

Does CHOOSECOLS work in Excel 2021?

No. It is available in Microsoft 365, Excel 2024 and later, and Excel for the web. In Excel 2021 and earlier it returns `#NAME?`.

Learn CHOOSECOLS in a real sheet.

CHOOSECOLS is taught in Lookups and references, lesson 19: CHOOSECOLS: picking and reordering columns. Each lesson is a short, graded exercise like the one above.