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: Performing Complex Sorts.

Performing Complex Sorts

Written by Allen Wyatt (last updated February 27, 2021)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365


By using the sorting capabilities of Excel, you can perform complex sorting of either an entire list or any portion of a list. If you want to sort an entire list, you only need to select a single cell within the list. If you want to sort a portion of a list, you need to select those rows (they must be contiguous) that you want sorted.

  1. Display the Data tab of the ribbon.
  2. Click the Sort tool. Excel displays the Sort dialog box. Using this dialog box, sorting is performed according to criteria you set. (See Figure 1.)
  3. Figure 1. The Sort dialog box.

  4. Use the Sort By drop-down to select the field (or column) by which you want to sort.
  5. Click Add Level each time you want to specify a secondary sorting key.
  6. Specify for each sorting key whether you want that field to be sorted in ascending or descending order.
  7. Click the Options button to display the Sort Options dialog box where you can specify whether you want capitalization to matter and whether you want to sort rows or columns. (See Figure 2.)
  8. Figure 2. The Sort Options dialog box.

  9. Click on OK to close the Sort Options dialog box.
  10. Click on OK to complete your sort.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (7216) 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: Performing Complex Sorts.

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

Sharing AutoText Entries

AutoText entries can make your writing more productive, if used effectively. Because of this, it can be advantageous for ...

Discover More

Automatically Saving Versions

The versioning feature in Word can be very handy as you develop your documents. Here's how to set it up so that a new ...

Discover More

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

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)

Forcing Excel to Sort Cells as Text

If you have a mixture of numbers and text in a column and you want to sort based upon that column, the results may not be ...

Discover More

Controlling Sorting Order

When you sort information in a worksheet, you have control over the order in which that information is sorted. Here's a ...

Discover More

Taking Bold Text into Account in a Sort

If 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 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 four minus 0?

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 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.