# Sort a SharePoint list by more than one column

> For the full documentation index, see https://250highstreet.com/llms.txt

> A SharePoint view sorts on one or two columns. Here is how to set both, and how to get a three-column sort with a calculated sort key column.

Short answer: a SharePoint view sorts by at most two columns. Choose Edit current view, then set First sort by and Then sort by. Microsoft's page says: "When you create or edit a view, you can specify sorting on one or two columns." For three or more columns, there is no third box. One way to start: add a calculated column that joins the values into one piece of text, then sort on that column.

## Two ways to sort, and why one of them does not stick

Microsoft describes two ways to sort a view. One is a quick sort from the column header. The other is a sort saved inside the view.

- Header sort: you select the header of a column and pick a sort. It works on one column at a time. Microsoft says: "When you close the list or library, the column will return to its default view order unless you save the view."
- View sort: you set the sort inside the view settings. It stays, and it can use two columns.

If you sort by a header and the list is back in the old order the next day, that is the reason. The header sort was never saved in the view.

## Step 1. Set up a list that sorts well

A sort only works as well as the columns under it. Before you set up any sort, check these four things.

1.  Use the Title column for the main item name. Rename it to something that fits, such as "Task" or "Request". Do not hide it and add a second name column.
2.  Make Priority a Choice column with numbers in front of the choices: 1 High, 2 Medium, 3 Low. Our advice, not a Microsoft rule: the number prefix keeps your order. Check the order on your own list after you set the sort.
3.  Make Due date a Date column, not a text column. Microsoft warns that a column with the wrong type sorts wrong. Its page says numbers stored as text sort incorrectly, and changing a column type can cause existing data to be lost. Pick the right type before you add data.
4.  Know which columns cannot be sorted. Microsoft's page lists these: multiple lines of text, Choice columns that allow multiple values, Hyperlink, and Image. If you turned on "allow multiple selections" for Priority, you cannot sort on it.

## Step 2. Sort a view on two columns

Open your list in Microsoft 365. Go to [https://www.microsoft365.com](https://www.microsoft365.com) if you need to find it. Exact names may differ on your screen.

1.  Open the list and select the view menu at the top right, then select Edit current view. Microsoft's page says: "Select Switch view options, and then Edit current view."
2.  Scroll down to the Sort section.
3.  For "First sort by the column", choose Priority. Choose ascending, so 1 High comes first.
4.  For the second level, choose Due date. Choose ascending, so the oldest date comes first.
5.  Select OK to save.

Now the list shows all 1 High items first. Inside that group, the items with the earliest due date come first. Then 2 Medium, and so on.

Two more facts from Microsoft's page help here. Sorting changes how items are shown. It does not add or remove anything from the view. And you can sort on columns that are not shown in the view: "You can sort on columns, even if they're not visible in the view."

Microsoft's page "Use sorting to modify a SharePoint view" in SOURCES covers the same steps.

## Step 3. Sort on three or more columns with a sort key

Say you want Priority, then Due date, then Title. That is three levels. The view has two. Our advice, test first: this is not a Microsoft rule, so try it on a copy of your list before you rely on it.

Make a calculated column that builds a single piece of text from the three values. Sort the view on that column.

1.  Add a new column. Choose "Calculated (calculation based on other columns)".
2.  Name it "Sort key".
3.  Set the data type returned to "Single line of text".
4.  Enter a formula like this:

=LEFT(\[Priority\],1)&IF(ISBLANK(\[Due date\]),"9999-12-31",TEXT(\[Due date\],"yyyy-mm-dd"))&\[Title\]

1.  Save the column.
2.  Edit the current view and set "First sort by the column" to Sort key, ascending.

Why this works: the formula joins three values into one line, such as "12026-11-05Order paper". A text sort reads that line from left to right. It looks at the priority number first, then the date, then the title. The date is written year, month, day, so it sorts in date order as text.

What each part does:

- LEFT(\[Priority\],1) takes the first character of the choice, the number. This only works while you have fewer than ten choices, because it takes one character.
- TEXT(\[Due date\],"yyyy-mm-dd") turns the date into text in year-month-day order. Microsoft's page says: "To combine text with a date or time, use the TEXT function and the ampersand (&) operator."
- IF(ISBLANK(\[Due date\]),"9999-12-31", ...) puts rows with no due date at the end of their priority.
- \[Title\] adds the item name last, so ties are sorted by name.

Microsoft's page lists the column types a formula can refer to: "single line of text, number, currency, date and time, choice, yes/no, and calculated."

Test the format text "yyyy-mm-dd" on one row first. The sort key should read like 12026-11-05Order paper. If it does not, fix the formula before you sort a whole list.

## Blank dates and the sort key

Our advice, not a Microsoft rule: the ISBLANK part of the formula sends rows with no due date to the end of their priority. Check one blank row after you save the column.

## Do not use today's date in the sort key

Do not try to sort by "days until due" in a calculated column. Microsoft's page says: "The TODAY and ME functions are not supported in calculated columns." They are supported in a column's default value, but that sets a value once when the item is made. It does not update. If you want "due soon" at the top, sort on the date itself. The oldest date is the most urgent.

For a view that shows only the items due today or only your own items, you need a filter. Microsoft's filtering page says: "You must use the classic view editor to filter columns using these keywords." Open Edit current view, then Filters. See "[Show each person only their own items in a SharePoint list view](/guides/sharepoint-list-view-filter-current-user/)".

## Sort inside groups

A view can also group items by one or two columns. Microsoft says: "you can specify grouping on one or two columns." It also says: "When you set up grouping, you specify ascending or descending order, so there's no need to also create a sort on the same field." So if you group by Priority, set the group order on Priority, and use the sort section for the next column, such as Due date. Our advice, not a Microsoft rule: if you mix groups with a calculated sort key, test a small view first.

## Folders can change the order

If your list has folders, Microsoft's page says folders appear above items in an ascending sort and below them in a descending sort by default. To change this, it says to select the option "Sort only by specified criteria (folders may not appear before items)". If your list has no folders, you can skip this.

## What to avoid

- Do not rely on a header sort for a list that other people use. It does not save. Save the sort in the view.
- Our advice, not a Microsoft rule: put number prefixes on Choice values you plan to sort on, then check the order.
- Do not store dates or numbers in text columns. They will sort in the wrong order.
- Do not put the sort key in a view that people read, unless you want it. You can sort on a column that is hidden from the view.
- Do not use \[Today\] or \[Me\] in a calculated column.
- Do not add a third sort level by building many calculated columns. One sort key column is enough.

## Honest limits

A sort key built from text breaks when a value changes length. A number column joined as text, for example 9 and 10, sorts "10" before "9". If you must join a number, pad it with zeros first, such as TEXT(\[Qty\],"000"). Our advice, not a Microsoft rule: test it with real values. Also, a sort key column adds one more column to maintain. If two levels are enough, skip it.

For the next step after you sort, see "[Turn overdue rows red in a SharePoint list](/guides/highlight-overdue-rows-sharepoint-list/)" and "[SharePoint calculated column formulas for due dates and status](/guides/sharepoint-calculated-column-formulas/)".

## When to get help

You can build all of this yourself in Microsoft 365. If you would rather have it built and tested for your team, I do that. A tracker like this is a fixed price: \$5,000 for one, built in 2 weeks. See "[What a SharePoint tracker costs to build](/guides/what-a-sharepoint-tracker-costs/)". Bring one example of the problem to a free call.

I am Al Davies. I run 250 High Street LLC and build SharePoint trackers and Power Automate flows for operations teams. I work remotely. The first call is free, and I will not try to sell you anything.

See trackers I built: [Tools I built](/portfolio/)

## FAQ

### Can a SharePoint list sort by more than two columns?

A view sorts by at most two. For three or more, build a calculated sort key column and sort on it.

### Where do I set a two-column sort in the modern list view?

Microsoft says: "Select Switch view options, and then Edit current view." Then use the Sort section: First sort by, then Then sort by.

### Why does my header sort go away?

A header sort works on one column. Microsoft says the column returns to its default view order when you close the list unless you save the view.

### Can I sort on a column that is not shown in the view?

Yes. Microsoft says: "You can sort on columns, even if they're not visible in the view."

### Which columns cannot be sorted?

Microsoft lists multiple lines of text, Choice columns that allow multiple values, Hyperlink, and Image columns.

## Sources

- [Microsoft Support, Use sorting to modify a SharePoint view](https://support.microsoft.com/en-us/office/use-sorting-to-modify-a-sharepoint-view-1e85d6e7-bdb3-4176-b1cb-62c5fbd3ef98)
- [Microsoft Support, Use grouping to modify a list or library view](https://support.microsoft.com/en-us/sharepoint/lists/use-grouping-to-modify-a-list-or-library-view)
- [Microsoft Support, Examples of common formulas in SharePoint lists](https://support.microsoft.com/en-us/office/examples-of-common-formulas-in-sharepoint-lists-d81f5f21-2b4e-45ce-b170-bf7ebf6988b3)
- [Microsoft Support, Introduction to SharePoint formulas and functions](https://support.microsoft.com/en-us/sharepoint/libraries/introduction-to-sharepoint-formulas-and-functions)
- [Microsoft Support, Use filtering to modify a SharePoint view](https://support.microsoft.com/en-us/office/use-filtering-to-modify-a-sharepoint-view-3d8efc52-0808-4731-8f9b-3dfaeacea3d4)

## Related guides

- [Filter Excel Online without changing it for everyone](/guides/excel-online-sheet-view/)
- [Use today's date in a SharePoint calculated column](/guides/sharepoint-calculated-column-today/)
- [SharePoint calculated column formulas for due dates and status](/guides/sharepoint-calculated-column-formulas/)

Source: https://250highstreet.com/guides/sharepoint-list-sort-by-multiple-columns/
