Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Google Sheets CHOOSECOLS Function Guide & Examples

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Google Sheets does not have a function called "CHITEST" (which is a statistical test found in Microsoft Excel); however, users searching for this often mean the CHOOSECOLS function, which allows you to extract specific columns from a range or array. To use CHOOSECOLS, you enter the formula =CHOOSECOLS(array, col_num1, [col_num2, ...]), where the array is your data source and the col_num represents the index of the column you want to retrieve. This is essential for cleaning large datasets where you only need a few specific pieces of information without manually deleting other columns.

What You'll Need

  • A Google account with access to Google Sheets.
  • A dataset consisting of multiple columns of data.
  • An understanding of which column numbers (indices) you wish to extract from your source data.

Step-by-Step

  1. Prepare Your Source Data: Ensure your data is organized in a clean table format. For example, if you have a sales sheet with columns for Date, Customer Name, Product, Region, and Amount, these are considered columns 1 through 5 respectively.
  2. Select the Destination Cell: Click on the empty cell where you want the extracted data to begin appearing. Because CHOOSECOLS returns an array, it will automatically "spill" the results into the adjacent cells to the right and below. Ensure there is enough empty space to avoid a #REF! error.
  3. Start the Formula: Type =CHOOSECOLS( into the cell.
  4. Define the Array: Highlight the range of cells containing your data or type the range manually (e.g., A1:E100). If your data is on another sheet, click that sheet tab and select the range. The formula should now look like =CHOOSECOLS(A1:E100,.
  5. Specify the Column Numbers: Enter the index number of the first column you want to keep. If you want the "Customer Name" (column 2) and the "Amount" (column 5), type 2, 5. The number refers to the position within the selected range, not necessarily the letter of the column in the spreadsheet. For example, if your range starts at column C, then column C is index 1.
  6. Close the Formula: Type the closing parenthesis ) and press Enter. Your selected columns will now appear in the new location.
  7. Dynamic Updating: Test the function by changing a value in the source data. You will notice that the CHOOSECOLS output updates automatically, as it maintains a live link to the original array.

Common Mistakes

One of the most frequent errors is the #REF! error caused by "blocking." Because CHOOSECOLS is a dynamic array function, it needs an unobstructed path to display the results. If there is any text or data in the cells where the function intends to place the extracted columns, Google Sheets will return a #REF! error stating that it cannot expand the result. To fix this, clear all cells to the right and below the formula cell.

Another common mistake is miscalculating the column index. Users often assume the index refers to the absolute column letter of the sheet (e.g., Column E is always 5). However, the index is relative to the range provided in the first argument. If your array is C1:G10, then Column C is 1, Column D is 2, and so on. If you enter 5 for a range that only has 3 columns, the formula will return a #VALUE! error because the index is out of bounds.

Users also occasionally forget that CHOOSECOLS does not sort or filter data. It only selects. If you need the data to be sorted by a specific column while also extracting only a few columns, you must wrap the CHOOSECOLS function inside a SORT function, or vice versa.

Tips

To make your spreadsheets more professional and flexible, combine CHOOSECOLS with the QUERY function or FILTER function. For instance, if you only want to see columns 1 and 3 for rows where the sales amount is greater than 1,000, you can nest these functions to create a highly specific data view without altering your master database.

If you need to extract columns in a different order than they appear in the source, CHOOSECOLS is the perfect tool. By simply changing the order of the numbers in the formula (e.g., =CHOOSECOLS(A1:E10, 5, 1, 2)), you can rearrange your data layout instantly without the tedious process of cutting and pasting columns.

For those dealing with massive datasets, consider using Named Ranges. Instead of typing A1:Z1000, you can name that area "SalesData" via the Data > Named ranges menu. Your formula then becomes =CHOOSECOLS(SalesData, 1, 3), which is much easier to read and maintain as your sheet grows.

You can also use negative numbers for column indices. In Google Sheets, a negative number counts from the right side of the range. For example, -1 refers to the very last column in the range, and -2 refers to the second to last. This is incredibly useful when you have a dataset where the total number of columns might change, but you always want the final column of data.

Troubleshooting

If your formula is not working, first check for the #VALUE! error. This almost always means your column index number is larger than the number of columns in your selected range. Double-check your range (the first part of the formula) and count the columns to ensure the index number exists within that span.

If you see a #N/A error, ensure that the range you have selected actually contains data. If the range is entirely empty, the function may struggle to return a valid array. Also, ensure there are no typos in the function name; it must be exactly CHOOSECOLS.

If the data is appearing but looks incorrect, check the relative positioning. If you shifted your data range by one column (e.g., from A:E to B:F), your index numbers will now point to different data points. You will need to adjust the numbers in the formula to match the new range.

If the sheet becomes slow, it may be because you have too many dynamic array formulas calculating simultaneously. To optimize performance, try to limit the number of CHOOSECOLS functions on a single tab, or consider converting the results to static values (Copy > Paste special > Values only) if the data no longer needs to be live.

Frequently Asked Questions

Can I use CHOOSECOLS to extract rows instead of columns?

No, CHOOSECOLS is specifically designed for columns. To extract specific rows from a range, you should use the CHOOSEROWS function, which works with the exact same logic but applies to the vertical axis of your data.

Does CHOOSECOLS work with data from other tabs?

Yes. You can reference another tab by including the sheet name followed by an exclamation mark in the array argument, such as =CHOOSECOLS('Sheet2'!A1:G100, 1, 2).

Can I select a range of columns (like 1 through 5) without typing every number?

CHOOSECOLS requires each index to be listed individually. If you need a continuous block of columns, it is simpler to use a standard range reference or the OFFSET function.

Will CHOOSECOLS keep the formatting of the original cells?

No. Like most Google Sheets formulas, CHOOSECOLS retrieves the data values but does not bring over cell colors, bold text, or border formatting. You will need to format the destination cells manually.

Can I use this function to merge columns from two different sheets?

Not directly within one CHOOSECOLS function, as it only takes one array. However, you can use curly brackets { } to create a custom array of multiple CHOOSECOLS functions, such as ={CHOOSECOLS(Sheet1!A:B, 1), CHOOSECOLS(Sheet2!A:B, 1)}.