Use sorting to modify a SharePoint view
Applies ToSharePoint Server Subscription Edition SharePoint Server 2019 SharePoint Server 2016 SharePoint Server 2016 Central Administration SharePoint Server 2013 SharePoint Server 2013 Enterprise SharePoint in Microsoft 365 SharePoint Foundation 2010 SharePoint Server 2010

Sorting helps you organize your data into a specific order based on column data. When you sort, you are only rearranging how the data is displayed, not adding or removing content that is displayed in the view.

There are two ways to sort a view:

Sort data quickly from within a view

In any view, select the header of a column of a list or library and select a sort.

The drop down sorting menu on a column header

You can choose any column to sort, but only one column at a time. When you close the list or library, the column will return to its default view order unless you save the view.

Create a sorted view

When you create or edit a view, you can specify sorting on one or two columns. You can sort on columns, even if they're not visible in the view. To set up a sort, follow these steps:

  1. On the menu bar near the top right, select Switch view options > Save view as and enter a name:

      The "Switch view options" menu.

    (The sort you've selected is saved with the view.)

  2. On the create or edit a view page, scroll down to Sort. In the Sort section, select the First sort by the column drop down and choose a field. This field is one of the many available columns for your list or library, and can be one that is in the view or not.

  3. Select Show the items in ascending order or Show the items in descending order.

  4. Scroll to the top or bottom of the page and select OK.

Modify a sorted view

  1. Open the list or library.

  2. Select Switch view options, and then Edit current view.

    Switch view options menu
  3. Scroll down to the Sort section.

  4. You can then change settings as outlined in steps 2 through 4 in the Create a sorted view procedure above.

When a column doesn't sort correctly

If a column isn't sorting accurately, the likely reason is that the column was set up for a different kind of data than it actually contains.

For example, Numbers and Text are different kinds of data, and each kind is sorted differently. If a Text column contains numerals rather than words, when you sort that column the numbering would be sorted inaccurately, like this: 

1, 11, 12, 2, 21, 22, 3, 4, 5, 6, 7, 8, 9 ...

You can fix this situation by changing the underlying Type setting for the column, as described below:

Change a column's Type to make it sort correctly

  1. Select the heading of the column you want to change, then select Column Settings > Edit.

  2. Under Type, select the downward pointing arrow to open the menu of options.

  3. Select the option that best fits the kind of data in the column. 

    Caution: When you change the type of information that a column holds, it is possible that some existing data will be lost from your column. But if you are choosing an option that matches the actual data in the column, data loss likely won't occur. For example, in the previously cited example, where you have a Single line of text column that's filled with numbers and you change the type to Numbers, the column data likely wouldn't disappear.

  4. Select Save.

  5. Test the sorting of the column to ensure it works as you expect.

How folders are sorted with other items

By default, folders are shown above any files or items (in an ascending sort), or below any files or items (in a descending sort) regardless of the name of the folder. 

If you want the sorting to also affect the position of the folders within the view, select Sort only by specified criteria (folders may not appear before items).

The column I want to sort by isn't available in the list

If a column contains one of the following types of data, it can't be sorted:

  • Multiple lines of text

  • Choice, where multiple values are allowed

  • Hyperlink

  • Image

Filter and group your sorted data view

You can combine sorting with a filtered and/or a grouped view. Grouping allows you to collapse sorted areas under headers, and filtering can be used to narrow down a large list of items.

To see how to group data in a view, see Use grouping to modify a SharePoint view.

To learn how to filter data in a view, see Use filtering to modify a SharePoint view.

There are two ways to sort a view:

Sort data quickly from within a view

In any view, select the header of a column of a list or library and select a sort.

The drop down sorting menu on a column header

You can choose any column to sort, but only one column at a time. When you close the list or library, the column will return to its default view order unless you save the view.

Create a sorted view

When you create or edit a view, you can specify sorting on one or two columns. You can sort on columns, even if they're not visible in the view. To set up a sort, follow these steps:

  1. Select the Library tab, and then select Create view.

  2. On the create or edit a view page, scroll down to Sort. In the Sort section, select the First sort by the column drop down and choose a field. This field is one of the many available columns for your list or library, and can be one that is in the view or not.

  3. Select Show the items in ascending order or Show the items in descending order.

  4. Scroll to the top or bottom of the page and select OK.

Modify a sorted view

  1. Open the list or library.

  2. Select the Library tab, and then select Modify View.

    SharePoint Online Ribbon Library tab modify view option

  3. Scroll down to the Sort section.

  4. You can then change settings as outlined in steps 2 through 4 in the Create a sorted view procedure above.

When a column doesn't sort correctly

If a column isn't sorting accurately, the likely reason is that the column was set up for a different kind of data than it actually contains.

For example, Numbers and Text are different kinds of data, and each kind is sorted differently. If a Text column contains numerals rather than words, when you sort that column the numbering would be sorted inaccurately, like this: 

1, 11, 12, 2, 21, 22, 3, 4, 5, 6, 7, 8, 9 ...

You can fix this situation by changing the underlying Type setting for the column, as described below:

Change a column's Type to make it sort correctly

  1. Select the heading of the column you want to change, then select Column Settings > Edit.

  2. Under Type, select the downward pointing arrow to open the menu of options.

  3. Select the option that best fits the kind of data in the column. 

    Caution: When you change the type of information that a column holds, it is possible that some existing data will be lost from your column. But if you are choosing an option that matches the actual data in the column, data loss likely won't occur. For example, in the previously cited example, where you have a Single line of text column that's filled with numbers and you change the type to Numbers, the column data likely wouldn't disappear.

  4. Select Save.

  5. Test the sorting of the column to ensure it works as you expect.

How folders are sorted with other items

By default, folders are shown above any files or items (in an ascending sort), or below any files or items (in a descending sort) regardless of the name of the folder. 

If you want the sorting to also affect the position of the folders within the view, select Sort only by specified criteria (folders may not appear before items).

The column I want to sort by isn't available in the list

If a column contains one of the following types of data, it can't be sorted:

  • Multiple lines of text

  • Choice, where multiple values are allowed

  • Hyperlink

  • Image

Filter and group your sorted data view

You can combine sorting with a filtered and/or a grouped view. Grouping allows you to collapse sorted areas under headers, and filtering can be used to narrow down a large list of items.

To see how to group data in a view, see Use grouping to modify a SharePoint view.

To learn how to filter data in a view, see Use filtering to modify a SharePoint view.

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.