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.
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
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:
Figure 1. The Custom Lists dialog box.
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.
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!
If you keep track of IP addresses in an Excel worksheet, you probably already know that it is difficult to sort those ...
Discover MoreIf you have some data in a worksheet that is bold, you may want to sort that data based on the text attribute. This is ...
Discover MoreClick the Sort tool in Excel, and you may be surprised that the data in your worksheet is jumbled. In order to sort ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
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
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.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2024 Sharon Parq Associates, Inc.
Comments