Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Creating a Sort Order.

Creating a Sort Order

Written by Allen Wyatt (last updated December 23, 2023)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021


1

There are times when a normal sorting order just doesn't cut it. Instead, you need a special sorting order that fits the type of data you are working with. In a previous tip you learned that you can instruct Excel to sort by a special sorting order, such as days of the week. You can also easily create your own sorting orders.

For instance, let's assume you have a field that can contain the name of one of four colors—Black, Red, Green, and Orange—and that you wanted your list sorted in that order. The problem is, Excel would normally sort this list alphabetically—Black, Green, Orange, and Red. The solution is to create a custom list that has the color names in the order you desire.

To create a custom list, follow these steps:

  1. Display the Excel Options dialog box. (In Excel 2007 click the Office button and then click Excel Options. In Excel 2010 or a later version display the File tab of the ribbon and then click Options.)
  2. If you are using Excel 2007, make sure Popular is selected at the left of the dialog box. If you are using a later version of Excel, click Advanced at the left side of the dialog box and scroll down to the General section.
  3. Click Edit Custom Lists. Excel displays the Custom Lists dialog box and hides the Excel Options dialog box. (See Figure 1.)
  4. Figure 1. The Custom Lists dialog box.

  5. Select the NEW LIST option from the Custom Lists list at the left of the dialog box.
  6. In the List Entries portion of the dialog box, start typing the order in which you want the elements sorted.
  7. When you are done, click the Add button.
  8. Repeat steps 4 through 6 to define any other lists desired.
  9. Click OK to finish.

In step 5 you need to enter information in the List Entries area of the dialog box. For this example you would type the following:

Black
Red
Green
Orange

Make sure you press Enter at the end of each element and that what you type matches exactly the possible contents of the sorting field. Once your lists are defined, you can use them to sort as described in other ExcelTips.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (8733) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. You can find a version of this tip for the older menu interface of Excel here: Creating a Sort Order.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Counting a Particular Word

Need to know how many times a particular word appears in a document or a portion of a document? Here's a handy trick that ...

Discover More

Making Templates Available to Word

Confused about where to store your templates in Word so that they are available when using the program? This tip ...

Discover More

Accepting All Deletions in a Document

When you use Track Changes in a document, it is easy to amass quite a few edits that you need to accept of reject. If you ...

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

More ExcelTips (ribbon)

Sorting Data Containing Merged Cells

When formatting the layout of your worksheet, Excel allows you to easily merge adjacent cells together. This can cause ...

Discover More

Importing Custom Lists

Custom lists are handy ways to enter recurring data in a worksheet. Here's how you can import your own custom lists from ...

Discover More

Preventing Jumbled Sorts

Click the Sort tool in Excel, and you may be surprised that the data in your worksheet is jumbled. In order to sort ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is four minus 0?

2023-12-23 15:16:10

J. Woolley

My Excel Toolbox includes the following dynamic array function to list all of Excel's Custom Lists (built-in plus user-defined) as an array with 1 column and N rows:
=ListCustomLists()
When using pre-2021 versions of Excel without support for dynamic arrays, review the PDF file UseSpillArray.pdf.
See https://sites.google.com/view/MyExcelToolbox


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.