Function Problems

How to Dynamically Filter, Sort, and Reorder Excel Table Columns

Amos GikundaAmos Gikunda Nov 10, 2026 868 views

Question details

Extract selected columns from a table, filter out blank values, reorder the columns, and sort the result dynamically.

How to Filter, Sort, and Reorder Excel Table Columns into a Custom Order
Product
Excel
Device & OS
not provided
Scenario
Reorganizing data from a larger dataset by displaying only specific columns, removing empty records, and automatically sorting them without manual copying.
Observed behavior
The user requires a dynamic array formula combination to achieve custom column extraction, filtering, and sorting in one continuous operation.
Before you start

Ensure you are using a modern version of your spreadsheet software that supports dynamic array functions like SORT, FILTER, and CHOOSECOLS.

Solution 1Recommended

Use SORT, FILTER, and CHOOSECOLS Functions

Combine three dynamic array functions to extract your desired columns, filter out blank rows, and sort the remaining data.

This method is highly efficient because it leverages nested dynamic arrays. CHOOSECOLS pulls out specific columns and places them in your preferred order, FILTER removes rows based on empty values, and SORT organizes the final output.

1
Identify your source data

Select the cell where you want your new dynamic table to start. Note the name or range of your source data (e.g., 'DataTable') and the index number of the column you want to check for blanks.

2
Set up the CHOOSECOLS and FILTER formula

Type the core formula to extract columns and filter blanks: =FILTER(CHOOSECOLS(DataTable,5,3,1), CHOOSECOLS(DataTable,5)<>""). This extracts columns 5, 3, and 1, but ignores rows where column 5 is blank.

3
Wrap with the SORT function

Enclose your formula within the SORT function to order the results alphabetically or numerically: =SORT(FILTER(CHOOSECOLS(DataTable,5,3,1), CHOOSECOLS(DataTable,5)<>"")). Press Enter to populate the dynamic table.

Use SORT, FILTER, and CHOOSECOLS Functions
Dynamic Updates: Because this utilizes dynamic array formulas, your extracted table will automatically update whenever the source 'DataTable' is modified.
Powerful Spreadsheet Solution

Process Dynamic Data Efficiently with WPS Spreadsheet

WPS Office fully supports dynamic array functions like FILTER, SORT, and CHOOSECOLS, allowing you to manipulate complex tables seamlessly and for free.

  1. 1. Open WPS Spreadsheet: Launch WPS Office and open your .xlsx workbook containing the source table.
  2. 2. Select the target cell: Click the empty cell where you want the dynamically sorted and filtered array to spill into.
  3. 3. Enter the dynamic formula: Input your nested formula, such as =SORT(FILTER(CHOOSECOLS(DataTable,5,3,1),CHOOSECOLS(DataTable,5)<>"")), and press Enter to instantly see your reordered table.
Full compatibility with Microsoft Excel (.xlsx) formats and dynamic formulas.Robust support for advanced dynamic array functions for data extraction.Lightweight, fast, and features a familiar user interface for immediate productivity.
microsoft office alternative - wps office

Frequently Asked Questions

What does the CHOOSECOLS function do?

The CHOOSECOLS function returns specific columns from an array or a range based on the column index numbers you provide. It allows you to both extract and completely reorder columns from your original dataset.

Why am I getting a #CALC! error when using the FILTER function?

The #CALC! error usually appears if the FILTER function evaluates to an empty array, meaning no rows meet your specified condition (e.g., all rows are blank in the checked column). You can add the optional [if_empty] argument in the FILTER function to display a custom message instead of an error.

Are dynamic array functions available in older spreadsheet versions?

No, dynamic array functions like SORT, FILTER, and CHOOSECOLS require modern spreadsheet software. They will not work in legacy versions like Excel 2016 or 2019. You must use Microsoft 365, Excel 2021, or compatible modern alternatives like WPS Office.