Sorting within a Chart

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


Charlie has some data that he used to create a bar chart. If he sorts the data on which the X axis is based, he can control the order in which the bars appear in the chart. It would be helpful to Charlie, though, if he could order the bars in the chart (from lowest to highest) without sorting the data on which the chart is based. He wonders if there is a way to sort the data series along the X axis without modifying his original data.

You cannot sort the actual bars in the chart (though that would be cool if you could); Excel provides no capability to do this. There are two ways that you can approach this issue, however. While it may not seem so at first, both approaches utilize the same concept, they just go about it differently.

Perhaps the easiest approach is to add helper columns to your original data table and then base the chart on those columns instead of the original. For instance, you could use the new SORT function to create helper columns that put your data in the desired sorted order, and then base your chart on that. The original data remains as it is, and you get the chart in the desired order.

The second potential solution is similar to the helper-column approach, as already mentioned. Instead of adding new columns, however, you simply add a PivotTable that is based on your data. The PivotTable can be massaged to present (and organize) just the data you want in your chart. You can then create a bar chart based on what is in the PivotTable. This approach is particularly appropriate if your original data is complex or multitudinous. The benefit of removing the chart from the original data by one step is that you don't need to reorganize the original data; it can remain as you desire.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (13816) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365.

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

Using Outline Numbering in a Table

If you have worked with tables in Word, you probably know how to navigate through the cells with keyboard shortcuts. This ...

Discover More

Counting Only Money Winners

If a series of cells contain the amount of money won by individuals, you may want to count the number of individuals who ...

Discover More

Understanding Computer Names

Every Windows computer on your network has a name. This name typically provides some identifying information about the ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More ExcelTips (ribbon)

Smoothing Out Data Series

One way you can make your charts look more understandable is by removing the "jaggies" that are inherent to line charts. ...

Discover More

How to Choose the Type of Chart to Use

Excel allows you to create all sorts of charts to visually display your data. With so many options available, how do you ...

Discover More

Negatives in Pie Charts

Pie charts are a great way to graphically display some types of data. Displaying negative values is not so great in pie ...

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