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

Swapping Two Cells

If you need to swap the contents of two cells in your worksheet, Excel provides a number of ways you can approach the ...

Discover More

Printing Post Office Permits on Envelopes

When preparing to snail-mail information, you may want to print your envelopes with permit information in the upper-right ...

Discover More

Superscripts in Custom Formats

When you create custom formats for your data, Excel provides quite a few ways you can make that data look just as you ...

Discover More

Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!

More ExcelTips (ribbon)

Undoing the Effects of a Sort

Have you ever put a lot of data into a worksheet, sorted that data, and then realized you shouldn't have done so? It is ...

Discover More

Separating Cells Based on Text Color

If the font color used for the data in your worksheet is critical, you may at some time want to move cells that use a ...

Discover More

Sorting an Entire List

Need to sort all the data in a table? Here's the fastest and easiest way to do it.

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

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.