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: Sorting a Range of Cells.

Sorting a Range of Cells

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


1

Peter asked if it is possible to sort a range of cells, and just that range. In other words, not to sort entire rows or entire columns. The answer is a resounding "yes," Excel allows you to do the sorting rather easily.

As an example, let's assume you want to sort the cells in the range of C10:F40, based on the values in column D. To do this, follow these steps:

  1. Select the range of cells.
  2. Display the Data tab of the ribbon.
  3. Click the Sort tool. Excel displays the Sort dialog box. (See Figure 1.)
  4. Figure 1. The Sort dialog box.

  5. Using the Sort By drop down list, choose Column D.
  6. Make sure the My Data Has Headers check box is cleared.
  7. Click on OK.

You can also sort by using the Sort Ascending or Sort Descending tools on the Data tab of the ribbon. The steps you follow are just a bit different:

  1. Select the range of cells.
  2. Press the Tab key to make sure that column D is selected. You can tell when it is selected because one of the cells in column D will appear in white, rather than being shaded.
  3. Click on Sort Ascending or Sort Descending.

Regardless of the technique you use, only the range of selected cells is sorted. All other information in the data table remains unaffected.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (11101) 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: Sorting a Range of Cells.

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

Tables within Tables

Inserting a table in a document is easy. Did you know that you can also insert a table within another table? Word allows ...

Discover More

Mixing Note Numbering

When inserting footnotes and endnotes in a document, most of us don't give much thought to the format used in the ...

Discover More

Can't Use Hyperlinks

Before some features in Excel can function properly, you must have the correct permissions set for the user of the ...

Discover More

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!

More ExcelTips (ribbon)

Sorting ZIP Codes

Sorting ZIP Codes can be painless, provided all the codes are formatted the same. Here's how to do the sorting if you ...

Discover More

Sorting Data on Protected Worksheets

Protect a worksheet and you limit exactly what can be done with the data in the worksheet. One of the things that could ...

Discover More

Sorting with Graphics

If you use graphics in a worksheet that are associated with certain cells (perhaps images of parts or icons for worksheet ...

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

2020-09-19 05:04:50

Kiwerry

A big THANK YOU for this one Allen. I have often wondered whether there is a quick way of sorting a range by a column other than the leftmost one, and here it is!


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.