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: Sorting by Colors.

Sorting by Colors

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


Excel allows you to sort the data in your worksheets by any number of attributes. One of the things that you can sort by is colors. Specifically, Excel allows you to sort by both the color of the cell and the color of the text within the cell. Follow these steps:

  1. Select the data that you want to sort or select a cell within the data you want to sort.
  2. Display the Data tab of the ribbon.
  3. Click the Sort tool. (It is in the Sort & Filter group on the Data tab of the ribbon.) Excel displays the Sort dialog box.
  4. Using the drop-down list in the Sort On column, select either Cell Color or Font Color, depending on which one you want to use in your sort. (See Figure 1.)
  5. Figure 1. The Sort dialog box when sorting by color.

  6. Using the drop-down list in the Order column, select the color by which you want to sort. (Excel allows you to sort by any color within the range you are sorting.)
  7. Using the second (right-most) drop-down list in the Order column, specify whether the color you picked in step 5 should be on top or on bottom.
  8. If you want to additionally sort by other colors, click the Add Level button and repeat steps 4 through 6 for the additional level.
  9. Click OK.

At this point your data is sorted according to the specifications you created.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (7926) 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: Sorting by Colors.

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

Determining If a File Exists

Before you have your macro open and read a file from disk, you'll want to check to make sure it is really there. Here's ...

Discover More

Permanent Watermarks in a Document

Need to add a graphic watermark to a document? It's not that hard to do, but making the watermark permanent can be a bit ...

Discover More

Bumping Numbers in a Document

If your documents include words that contain numbers (such as a list of parts numbers) you may need a way to increment ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 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

Preventing Jumbled Sorts

Click the Sort tool in Excel, and you may be surprised that the data in your worksheet is jumbled. In order to sort ...

Discover More

Incorrect Links after Sorting Hyperlinks

When you sort your data, you should always check to see if the sort was done correctly. What if sorting messes up ...

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