How to Set a Custom Sort Order for Documents in a SharePoint Library
Question details
The user needs to manually define the sequence in which documents appear in a SharePoint library, rather than relying on default alphabetical or numerical sorting.
- Product
- SharePoint
- Device & OS
- not provided
- Scenario
- Organizing files such as a manual or structured guide where documents must appear in a specific, non-alphabetical reading order.
- Observed behavior
- By default, SharePoint document libraries only sort file names alphabetically or numerically, which disrupts the required manual document sequence.
Ensure you have the necessary Edit or Full Control permissions for the SharePoint document library to create new columns and modify the default view.
Create a Custom Numeric Order Column
Assign a manual numerical value to each document to dictate its exact position in the library view.
This is the most straightforward method for creating a custom sort order. By adding a dedicated number column, you can assign a precise position to each document and then hide the column to keep the library interface clean.
Navigate to your SharePoint document library. Click on 'Add column' at the end of the header row, select 'Number' from the options, name it 'SortOrder', and click 'Save'.
Select each document in the library, open the details pane, and input the desired sequence number (e.g., 1, 2, 3) into the newly created 'SortOrder' field.
Click on the 'SortOrder' column header and select 'Sort ascending' to rearrange the documents according to your custom sequence.
To clean up the view, click 'Add column', select 'Show/hide columns', uncheck the 'SortOrder' column, and click 'Apply'. Save the view if prompted.
Use a Calculated Column for Automated Sorting
Automatically assign custom sort weights to documents based on their category using a calculated formula.
Edit Your SharePoint Documents with WPS Office
While SharePoint handles your team's cloud storage, WPS Office provides a lightweight, fast, and completely free alternative for editing the Word, Excel, and PowerPoint files stored within your library.
- 1. Download WPS Office: Install the free WPS Office suite on your Windows, Mac, or Linux computer.
- 2. Open downloaded files: Download your categorized documents from SharePoint and open them directly in WPS Office.
- 3. Edit and save: Make your edits with full formatting compatibility and upload the finalized versions back to your SharePoint library.

Frequently Asked Questions
Will hiding the custom sort column disrupt the sequence?
No. Once you configure the library view to sort by your custom column and save the view settings, hiding the column from the display will not affect the sorting order.
Why is my calculated column sorting files like 1, 10, 2, 3?
This happens when the calculated column's return data type is set to 'Single line of text'. To fix this, edit the column settings and change the return data type to 'Number' so it sorts numerically.
Can I apply this custom sort order to folders as well?
Yes. If your custom column is applied to the folder content type, you can assign numeric values to folders just like files, allowing you to sequence folders manually within the SharePoint library view.




