ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Data tools
  3. Custom Sort in Excel: Sort by Your Own Order

Custom Sort in Excel: Sort by Your Own Order

By ExcelReady Team·Updated November 1, 2026·5 min read

The short answer

To do a custom sort in Excel, go to Data > Sort, choose the column in Sort by, and set Order to Custom List. Type your order, such as High, Medium, Low, click Add and then OK. Excel sorts the rows in that order instead of alphabetically. With a formula, use =SORTBY(A2:C9,MATCH(B2:B9,E2:E4,0)), where E2:E4 holds the order.

Key takeaways

  • A to Z puts High, Low, Medium in the wrong order; a custom list fixes it.
  • Set Order to Custom List in the Sort dialog, type the items in order and click Add.
  • Days of the week and months are built-in custom lists, so they sort in calendar order.
  • SORTBY with MATCH sorts by a list in cells and updates when the data changes.
  • Items missing from the list cause errors in MATCH; wrap it in IFERROR to put them last.
On this page+
  1. Why A to Z isn't always the right order
  2. How to do a custom sort with a custom list
  3. Built-in custom lists: days and months
  4. How to save a custom list for every workbook
  5. Custom sort with more than one level
  6. How to do a custom sort with a formula
  7. Custom sort in older Excel with a helper column
  8. Practise it

A custom sort in Excel puts rows in an order you choose, such as High, Medium, Low, or Small, Medium, Large, instead of alphabetical order. You set it up once in the Sort dialog with a custom list, or you write it as a formula with SORTBY and MATCH. This guide shows both, plus the built-in lists for days and months.

Why A to Z isn't always the right order#

Alphabetical sorting only looks at letters. That works for names, but not for words with a meaning order. Sort this ticket list A to Z by Priority and you get High, High, High, Low, Low, Low, Medium, Medium. Low ends up before Medium, which no manager wants.

The examples use this list in A1:C9:

ABC
1TicketPriorityOwner
2T-01LowJamal
3T-02HighSara
4T-03MediumWei
5T-04HighJamal
6T-05LowSara
7T-06MediumJamal
8T-07HighWei
9T-08LowWei

Other common cases: sizes (S, M, L, XL), stages (Lead, Proposal, Won), and departments in the order your company lists them. If you need the basics of sorting first, see the guide to sorting data in Excel.

How to do a custom sort with a custom list#

  1. Click any cell inside the data.
  2. Go to Data > Sort. Make sure My data has headers is ticked.
  3. In Sort by, choose Priority. Leave Sort On as Cell Values.
  4. Open the Order drop-down and choose Custom List.
  5. With NEW LIST selected, type the entries in the List entries box, one per line: High, Medium, Low.
  6. Click Add, then OK. The Order box now shows "High, Medium, Low".
  7. Click OK to sort.

The tickets now run T-02, T-04, T-07 (High), then T-03, T-06 (Medium), then T-01, T-05, T-08 (Low). Rows with the same priority keep their original order.

To sort the other way, open Order again and choose Low, Medium, High, which Excel offers automatically once your list exists.

Built-in custom lists: days and months#

Excel already knows four lists, so you don't need to create them:

ListEntries
Short daysSun, Mon, Tue, Wed, Thu, Fri, Sat
Full daysSunday, Monday, Tuesday ... Saturday
Short monthsJan, Feb, Mar ... Dec
Full monthsJanuary, February, March ... December

Choose one under Order > Custom List when a column holds month or day names as text. If the column holds real dates instead, a normal Oldest to Newest sort is enough. The same lists power AutoFill: type "Mon" in a cell and drag the fill handle to get Tue, Wed and so on.

How to save a custom list for every workbook#

Lists you add in the Sort dialog are saved on your computer, so you can reuse them in any file. To manage them directly:

  • Windows: File > Options > Advanced, scroll to General and click Edit Custom Lists.
  • Mac: Excel > Preferences > Custom Lists.

Here you can type a new list, delete one, or import a list from cells. Select a range such as E2:E4 that already holds High, Medium, Low, and click Import. Note that custom lists are stored on your computer, not in the workbook, so a colleague opening the file won't have them.

Custom sort with more than one level#

A custom order can be one level of a bigger sort. To sort by priority, then by owner A to Z within each priority:

  1. Set up the Priority level with your custom list, as above.
  2. Click Add Level.
  3. In Then by, choose Owner with A to Z.
  4. Click OK.

Within High, Jamal (T-04) now comes before Sara (T-02) and Wei (T-07). The guide on how to sort by multiple columns explains how levels work.

How to do a custom sort with a formula#

In Excel 2021, Excel 2024 or Microsoft 365, you can sort by your own order with a formula that updates as the data changes. Type the order in cells, say E2:E4 (High, Medium, Low), then:

Excel formula
=SORTBY(A2:C9,MATCH(B2:B9,E2:E4,0))

How it works:

  1. MATCH(B2:B9,E2:E4,0) finds each priority's position in your list: Low becomes 3, High becomes 1, Medium becomes 2.
  2. SORTBY sorts the whole table by those numbers, smallest first.

The result spills the same order as the Sort dialog. Change the list to Low, Medium, High, and the result flips at once. You can also put the order inside the formula with curly brackets: MATCH(B2:B9,{"High","Medium","Low"},0). XMATCH works too: XMATCH(B2:B9,E2:E4).

If a priority isn't in your list, such as "Urgent", MATCH returns #N/A and the formula fails. Wrap MATCH in IFERROR to send unknown values to the end:

Excel formula
=SORTBY(A2:C9,IFERROR(MATCH(B2:B9,E2:E4,0),99))

For more on the function, see SORT and SORTBY, and for choosing between them, SORT vs SORTBY.

Custom sort in older Excel with a helper column#

Without SORTBY, add a helper column that turns the order into numbers, then sort by it:

  1. In D2, type =MATCH(B2,$E$2:$E$4,0) and fill it down to D9.
  2. Sort the table by column D, Smallest to Largest.

This works in every version. You can hide column D afterwards. The trade-off between sorting in place and sorting with a formula is covered in the Sort button vs the SORT function.

Practise it#

Custom orders come up whenever data has categories, and tests like to check that you don't settle for A to Z. Practise sorting and filtering a table with the ribbon tools, then practise the SORT function in a live spreadsheet, where you type the formula and it checks it instantly. Try the SORTBY exercise on this page first.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

Sort the tickets by priority in the order listed in E2:E4 (High, Medium, Low). In G2, use SORTBY on A2:C9 and sort by MATCH of the priorities in B2:B9 against E2:E4.

fx
ABCDEFGH
1
Ticket
Priority
Owner
Order
2
T-01
Low
Jamal
High
3
T-02
High
Sara
Medium
4
T-03
Medium
Wei
Low
5
T-04
High
Jamal
6
T-05
Low
Sara
7
T-06
Medium
Jamal
8
T-07
High
Wei
9
T-08
Low
Wei
10
11
12

Tip: MATCH(B2:B9,E2:E4,0) turns High into 1, Medium into 2 and Low into 3. SORTBY then sorts the table by those numbers.

Practise this in a lesson

LessonFilter a tableTurn on filter buttons with Ctrl+Shift+L, filter by one or several values and by a number condition, total and count only the visible rows with SUBTOTAL, then clear the filters.LessonSORT: order data with a formulaSort a table by any column, ascending or descending, and combine SORT with FILTER and UNIQUE.

Frequently asked questions

How do I create a custom sort order in Excel?

+

Go to Data > Sort, choose the column, and in Order pick Custom List. Select NEW LIST, type the items in the order you want, one per line, click Add and then OK.

How do I sort by High, Medium and Low in Excel?

+

Use a custom list with the entries High, Medium, Low in the Sort dialog's Order box. With a formula, use SORTBY with MATCH against a list of the three words in cells.

How do I sort by month name instead of alphabetically?

+

In the Sort dialog, set Order to Custom List and choose the January, February, March list, or the Jan, Feb, Mar list for short names. Excel includes these lists already.

Where are custom lists saved in Excel?

+

On Windows, go to File > Options > Advanced and click Edit Custom Lists in the General section. On a Mac, go to Excel > Preferences > Custom Lists. Lists saved there are available in every workbook on that computer.

Can I do a custom sort with a formula?

+

Yes, in Excel 2021, Excel 2024 or Microsoft 365. Use =SORTBY(data,MATCH(column,order_list,0)). MATCH turns each value into its position in your list, and SORTBY sorts by those positions.

Sources

  • Sort data in a range or table - Microsoft Support
  • SORTBY function - Microsoft Support
  • MATCH function - Microsoft Support

Written and checked by the ExcelReady Team. First published November 1, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. Why A to Z isn't always the right order
  2. How to do a custom sort with a custom list
  3. Built-in custom lists: days and months
  4. How to save a custom list for every workbook
  5. Custom sort with more than one level
  6. How to do a custom sort with a formula
  7. Custom sort in older Excel with a helper column
  8. Practise it

Keep reading

Data tools· 6 min read

How to Sort Data in Excel by One or More Columns

To sort data in Excel by one column, click any cell in that column and choose Data > Sort A to Z or Sort Z to A. To sort by several columns, choose Data > Sort, pick the first column, then click Add Level for the next one. Click a single cell first so Excel keeps each row together.

Comparisons· 7 min read

Sort Button vs SORT Function in Excel

The Sort button on the Data tab rearranges the rows of your table in place, once, and works in every version of Excel. The SORT function leaves the original data alone and returns a sorted copy that updates when the data changes, but it needs Excel 2021, Excel 2024, Microsoft 365 or Excel for the web.

Dynamic arrays· 6 min read

Sort by Multiple Columns in Excel (Formula and Menu)

To sort by multiple columns in Excel, go to Data > Sort, pick the first column in Sort by, then click Add Level and pick the second column in Then by. For a live result, use a formula instead: =SORTBY(A2:C9,A2:A9,1,C2:C9,-1) sorts by column A from A to Z, then by column C from largest to smallest.

More on data tools

  • Data Bars, Color Scales and Icon Sets in Excel
  • Create a Drop-Down List in Excel
  • How to Filter Data in Excel (Ctrl+Shift+L)
  • How to Make a Frequency Table in Excel
  • Find and Highlight Duplicates in Excel
  • Highlight an Entire Row Based on a Cell Value
All data tools articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free