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

Adjusting Dot Leader Spacing

Word allows you to use leader dots with your tab stops. If you want to space out the leader dots, you are limited in what ...

Discover More

Counting Unique Values with Functions

Using Excel to maintain lists of information is not unusual. When working with the list you may need to determine how ...

Discover More

Selecting the Entire Document with the Mouse

Want a quick way to select your entire document without taking your hand off the mouse? Try clicking away using the ...

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)

Reordering the Display of a Data Series

Once you create a chart, you aren't limited to keeping the data series in the order they originally appeared. You can ...

Discover More

Creating a Log/Log Chart

If you need to create a chart that uses logarithmic values on both axes, it can be confusing how to get what you want. ...

Discover More

Printing a Chart Across Multiple Pages

Wouldn't it be great to have your huge charts print out on multiple pieces of paper that you could then piece together? ...

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 1 + 1?

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.