4.4.8 Sorting Worksheet Data

You can sort individual columns, multiple columns, a range of worksheet data, or an entire worksheet. Origin offers simple sorting as well as nested sorting:

Simple Sorting

In simple sorting, the specified data is sorted using one "sort by" column and a selected sort order.


To perform a simple sort of the selected data:

Notes: If you select Ascending or Descending sub-menu, Origin sorts only the selected data based on the leftmost selected data set and the chosen sort order.


Note that if you highlight a range of rows, and not the entire column(s), the sort menu command which is enabled will be Worksheet: Sort Range.


To perform a simple sort on the entire worksheet:

  1. Select Worksheet: Sort Worksheet.
  2. Specify Ascending or Descending.

With the exception of Text/CSV and Excel, data imported using a Data Connector are, by default, locked to editing. To unlock, click on the Connector icon Dadta connector icon connect.png and choose Unlock Imported Data.

Nested Sorting

To perform a nested sort on the selected data:

  1. Select Worksheet: Sort Columns: Custom.

or

  1. Click the Sort button Button Sort.png on the Worksheet Data toolbar.


To perform a nested sort on the entire worksheet:

  1. Select the entire worksheet and select Worksheet:Sort worksheet:Custom

or

  1. Select the entire worksheet and click the Sort button Button Sort.png on the Worksheet Data toolbar.


The Nested Sort Dialog Box

Sorting Worksheet Data.png

Select the column for the primary sort from the Selected Columns list box and click the Ascending or Descending button. Then select the column for the secondary sort from the Selected Columns list box and click the Ascending or Descending button. Select additional columns as needed.

After clicking OK, Origin sorts the selected data so that the primary column is in ascending or descending order, as specified. If there are multiple rows with the same value in the primary column, the values in the corresponding rows of the secondary column, and the sort order chosen for the secondary column, are used to determine the ordering. This nesting process is continued down to the last column in the Nested Sort Criteria list box.

Custom Sorting of Categorical Data

The Nested Sort dialog can also be used for Custom sorting of the worksheet on categorical data columns.

  1. With the worksheet active, click Worksheet: Sort Worksheet: Custom.
  2. In the left panel, under Selected Columns, highlight a column which has been Set As Categorical. A Categorical button is added to the center panel.
  3. Click the Categorical button to add the highlighted categorical column to Nested Sort Criteria:
Custom sort categorical.png