logo
search
Others

How to Sort Excel Data Horizontally from Left to Right

Maira MehtabMaira Mehtab Sep 22, 2026 870 views

Question details

The user wants to know how to sort data horizontally across columns rather than vertically across rows in a spreadsheet.

Product
Excel
Device & OS
not provided
Scenario
Organizing spreadsheet data horizontally.
Observed behavior
The user needs to change the default vertical sort orientation to sort left-to-right based on specific row values.
Before you start

Ensure that your dataset does not contain any merged cells in the range you intend to sort, as merged cells will prevent the sorting function from executing properly.

Solution 1Recommended

Change Sort Orientation to Left to Right

Adjust the built-in sort orientation settings in the Data tab to sort data across columns.

By default, spreadsheet applications sort data from top to bottom (vertically). However, you can easily change the orientation in the Sort dialog box to sort data across columns (horizontally). This is particularly useful when you have a wide dataset organized row by row.

1
Select the data range

Highlight the specific range of cells you want to sort. Be sure not to select row headers if you want them to remain in place on the left.

2
Open the Sort dialog box

Navigate to the 'Data' tab on the top ribbon menu and click on the 'Sort' button to open the custom sorting window.

3
Modify the sort orientation

Click the 'Options...' button located at the top of the Sort dialog box. Under the 'Orientation' section, select the 'Sort left to right' radio button and click 'OK'.

4
Specify row sorting criteria

In the 'Sort by' dropdown menu, select the specific Row index you want to base your sort on. Choose your desired sorting order (such as A to Z, or Z to A), and click 'OK' to apply the changes.

Select Row Numbers Instead of Column Letters: When sorting left to right, your criteria dropdown will display Row numbers (e.g., Row 1, Row 2) instead of the usual Column letters (e.g., Column A, Column B).
Data Management in WPS Spreadsheet

Sort Data Horizontally with WPS Spreadsheet

WPS Spreadsheet provides a seamless and user-friendly way to organize your data. You can easily switch between vertical and horizontal sorting to arrange your rows and columns exactly as needed without relying on complicated formulas.

  1. 1. Open your file in WPS Spreadsheet: Launch WPS Office and open your workbook containing the data to be sorted.
  2. 2. Select the target data: Highlight the range of cells you want to sort horizontally with your mouse.
  3. 3. Access Custom Sort: Navigate to the Data tab on the main ribbon, click the Sort icon, and choose Custom Sort from the drop-down menu.
  4. 4. Apply Left to Right sorting: In the Custom Sort window, click Options, select 'Sort left to right', set your primary row criteria, and click OK to rearrange your columns.
Easily sort data horizontally (left to right) or vertically with customizable custom sort options.Fully compatible with Microsoft Excel (.xlsx, .xls) file formats, ensuring your sorting logic stays intact.Free and lightweight office suite with an intuitive ribbon interface familiar to Excel users.
microsoft office alternative - wps office

Frequently Asked Questions

Why is the 'Sort left to right' option not sorting my headers correctly?

If your column headers are included in the selected range, they will be sorted along with the rest of the data. To prevent headers from moving, do not highlight the row containing your column labels when selecting the range to sort.

Why is my Sort option greyed out or returning an error?

This typically happens if your selected range includes merged cells, or if you are attempting to sort within a formatted Excel Table. You must unmerge any merged cells or convert the Excel Table to a standard range before performing a horizontal sort.

Can I sort multiple rows horizontally at the same time?

Yes. After selecting 'Sort left to right' in the Options menu, click 'Add Level' in the Sort dialog box. This allows you to sort by a primary row first, and then sort any duplicate values using a secondary row.