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

Reading a PDF Newsletter on a Cell Phone

Sometimes creating a Word document is just the first step. Often you'll want to then convert it to a PDF file that can be ...

Discover More

Permanently Turning Off the Tracking of Formatting Changes

The Track Changes tool can be a great asset when you are working on a document with others. It can also be a hassle if ...

Discover More

Inserting from the Clip Art Gallery Doesn't Work

Ever insert a picture and it won't display in your document? It could be due to some of the display settings in Word. ...

Discover More

Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel 2013 Data Analysis and Business Modeling today!

More ExcelTips (ribbon)

Sorting Dates by Month

Sorting by dates is easy, and you end up with a list that is in chronological order. However, things become a bit more ...

Discover More

Understanding Ascending and Descending Sorts

When you sort information, Excel follows a set pattern of how your data is organized. This tip illuminates the burning ...

Discover More

Sorting with Graphics

If you use graphics in a worksheet that are associated with certain cells (perhaps images of parts or icons for worksheet ...

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 five more than 3?

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.