Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. 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: Storing Sorting Criteria.

Storing Sorting Criteria

Written by Allen Wyatt (last updated July 29, 2024)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365


3

Stephanie often has to perform sorts of her data using the same criteria over and over again. For instance, she often needs to perform a sort that uses the same four columns. She wonders if there is a way to "store" a set of sorting criteria so she doesn't need to enter them over and over again.

There are a couple of ways that you can approach this issue. The first is to create multiple custom views (described in other issues of ExcelTips) that include your data sorted in a desired manner. You would need to create one custom view for each of the sorting criteria you use. You can always store and recall the view to see it sorted as you want.

You could also make sure the data in your worksheets is defined as a formal data table. All you need to do is select a cell in the data and press Ctrl+T or display the Insert tab of the ribbon and click the Table tool. Once the data table is set up and you sort it, Excel stores the sorting criteria with the workbook so it is available when you later work with the table.

Perhaps the most flexible approach, however, is to perform your sorting in a macro instead of by using the Sort dialog box. You can easily use the macro recorder to set up and execute your sort; later running the macro will sort the same area over again, using the same criteria.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

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

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

Ignoring Punctuation in Names

If you have a word that includes punctuation as part of the word itself, then you may be frustrated by how Word treats ...

Discover More

Consolidating Changes under a Single User

When using Track Changes, you may want to have your edits appear to be those of a different user. Here's how to fool Word ...

Discover More

Automatically Formatting Text within Quotes

Some people use quote marks around text to make it stand out. At some point you may want to treat the quoted text ...

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)

Can't Sort Imported Data

Import information from an external database, and you'll no doubt want to use Excel's simple tools to manipulate that ...

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

Sorting IP Addresses

If you keep track of IP addresses in an Excel worksheet, you probably already know that it is difficult to sort those ...

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

2024-07-30 00:30:56

Philip

Custom Views ... won't work if there's even one Table in your Workbook. A bug that's been around since the beginning of time ...


2021-01-25 09:54:21

Mary

I find the best way to store sorted data is using Excel's power query.


2021-01-23 14:56:34

ron

There is another option. Do the sort in PowerQuery. Sort order is saved as one of the steps in the Query.


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.