Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Creating a Sort Order.

Creating a Sort Order

Written by Allen Wyatt (last updated September 21, 2022)
This tip applies to Excel 97, 2000, 2002, and 2003


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 the 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. Select Options from the Tools menu. Excel displays the Options dialog box.
  2. Make sure the Custom Lists tab is selected. (See Figure 1.)
  3. Figure 1. The Custom Lists tab of the Options dialog box.

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

In step 4 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 (2920) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) 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

Calculating Months of Tenure

Need to know the number of months between two dates? It's easy to figure out if you use the DATEDIF function.

Discover More

Conditional Formatting

One of the powerful features of Excel is the ability to format a cell based on the contents of that cell or another. It ...

Discover More

Making Sure Word Doesn't Capitalize Anything Automatically

Word, in an effort to be helpful, will often change the capitalization of the words you type. If you tire of Word's ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More ExcelTips (menu)

Moving Cell Borders when Sorting

Sort your data and you may be surprised at what Excel does to your formatting. (Some formatting may be moved in the sort ...

Discover More

Automatically Sorting as You Enter Information

When entering information into a worksheet, you may want it to always be in a correctly sorted order. Excel allows you to ...

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
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 two less than 9?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon 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.