logo
search
Others

Fix Excel Sort Not Keeping All Columns Together

Maira MehtabMaira Mehtab Sep 20, 2026 868 views

Question details

The user is experiencing an issue where sorting an Excel workbook does not correctly include all columns, specifically leaving behind formula columns like COUNTIFS.

Product
Microsoft Excel
Device & OS
not provided
Scenario
Attempting to sort a large company workbook containing complex formulas across multiple columns.
Observed behavior
The sorting process fragments the data rows because it fails to keep the formula columns aligned with the primary data columns being sorted.
Before you start

Before troubleshooting the sorting issue, verify that your dataset does not contain completely blank columns or rows, as these can break the contiguous range recognized by the software.

Solution 1Recommended

Manually Select the Entire Data Range

Selecting the complete dataset manually ensures that no columns separated by blanks or containing complex formulas are left behind during the sort.

1
Select the Starting Cell

Click on the top-left cell of your dataset.

2
Highlight the Full Table

Drag your cursor or use the keyboard shortcut Ctrl + Shift + Arrow Keys to highlight the entire table, making sure the columns containing the COUNTIFS formulas are included in the selection.

3
Initiate the Sort

Navigate to the 'Data' tab on the ribbon and click 'Sort'.

4
Apply Sorting Criteria

Set your desired sorting criteria in the dialog box and click 'OK' to sort the entire selected range together.

Check Data Selection: Always visually confirm that the gray selection highlight covers every column of your table before clicking the Sort button.
Efficient Data Sorting with WPS

Easily Sort Large Datasets and Keep Formula Columns Together Using WPS Office

WPS Spreadsheet provides a robust and intuitive sorting feature that handles contiguous data ranges perfectly, ensuring that your formula columns stay aligned with your sorted rows without manual range adjustments.

  1. 1. Open the File: Launch WPS Spreadsheet and open your existing Excel workbook.
  2. 2. Select the Range: Highlight your entire data table, including all columns with formulas.
  3. 3. Apply Custom Sort: Go to the 'Data' tab, click 'Sort', and choose your preferred sorting criteria to keep all data rows together seamlessly.
Flawlessly sorts large datasets while keeping COUNTIFS and other formula columns intact.Fully compatible with Microsoft Excel (.xlsx, .xls, .csv) formats and complex formulas.Provides advanced custom sorting options with a highly intuitive user interface.Lightweight software that handles massive datasets smoothly without freezing.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my spreadsheet only sort some of my columns?

Spreadsheet software relies on contiguous data to automatically select the range for sorting. If there is a completely blank row or column in your table, the automatic selection stops there, leaving the remaining columns unsorted. Manually highlighting the entire range fixes this.

Can COUNTIFS formulas break the sorting function?

Formulas themselves do not break sorting. However, if formula columns recalculate based on absolute references or are separated from the main data block by a blank column, they may not visually align correctly with the rest of the row after sorting.

How do I safely share a company workbook for troubleshooting?

You should never share sensitive company data. Instead, create a copy of the workbook, replace the real data with dummy information, and delete unnecessary sheets while keeping the problematic formula structure intact before sharing.